80eeb389af
PROBLEM: Invoke-RemoteBuild.ps1 was creating a placeholder artifact when the build
produced no dist/ directory. In production this hides build defects (build exits 0
but produces nothing = silent failure treated as success).
SOLUTION: Add explicit -SkipArtifact switch to the call chain:
Invoke-RemoteBuild.ps1:
- Add -SkipArtifact switch. When set: skips packaging entirely (no zip created).
- When absent (production default): missing GuestArtifactSource is a hard error
with a clear message pointing to -SkipArtifact as the opt-in for no-output builds.
Invoke-CIJob.ps1:
- Add -SkipArtifact switch. Passes it to Invoke-RemoteBuild.ps1.
- Phase 6 (Get-BuildArtifacts) is entirely skipped when set; logs 'skipped' event.
Test-CapacityBurnIn.ps1:
- Add -SkipArtifact switch. Adds '-SkipArtifact' flag to each child job argList.
Start-BurnInTest.ps1:
- Always passes -SkipArtifact by default (burn-in uses delay commands, no output).
- Add -NoSkipArtifact override switch for runs that do produce real artifacts.
- Remove -NoSkipArtifact escape from wrapper: default burn-in never needs artifacts.
79 lines
3.0 KiB
PowerShell
79 lines
3.0 KiB
PowerShell
#Requires -Version 5.1
|
|
<#
|
|
.SYNOPSIS
|
|
Wrapper di lancio per Test-CapacityBurnIn.ps1 con i parametri del lab locale.
|
|
|
|
.DESCRIPTION
|
|
Esegue il burn-in a 4 job / 3 round contro il repo burnin-dummy su Gitea.
|
|
Tutti i parametri fissi del lab sono qui hardcoded; i parametri variabili
|
|
(Rounds, Parallelism, BuildCommand) possono essere sovrascritti da CLI.
|
|
|
|
Prerequisiti:
|
|
- Repo burnin-dummy creato su Gitea (anche vuoto con branch main)
|
|
- Credenziali guest nel Credential Manager target 'BuildVMGuest'
|
|
- Gitea PAT nel Credential Manager target 'GiteaPAT'
|
|
New-StoredCredential -Target 'GiteaPAT' -UserName 'ci' -Password '<pat>' -Persist LocalMachine
|
|
- Template WinBuild2025 con snapshot BaseClean in stato powered-off
|
|
- VMware Tools attivo nel guest (per auto-detect IP)
|
|
|
|
Esempi di utilizzo:
|
|
# Run completo (3 round, 4 job paralleli)
|
|
.\Start-BurnInTest.ps1
|
|
|
|
# Smoke veloce (1 round, 2 job)
|
|
.\Start-BurnInTest.ps1 -Rounds 1 -Parallelism 2
|
|
|
|
# Verifica parallelismo reale (build da 2 minuti, 1 round)
|
|
.\Start-BurnInTest.ps1 -Rounds 1 -BuildCommand 'Start-Sleep 120'
|
|
|
|
.PARAMETER Rounds
|
|
Numero di round sequenziali. Default: 3.
|
|
|
|
.PARAMETER Parallelism
|
|
Job concorrenti per round. Default: 4.
|
|
|
|
.PARAMETER BuildCommand
|
|
Comando da eseguire nel guest come passo build (eseguito via cmd /c nel guest).
|
|
Default: 'ping 127.0.0.1 -n 31 > nul' (attesa ~30s, nessun output reale).
|
|
Quando il build command non produce la directory dist, Invoke-RemoteBuild crea
|
|
automaticamente un artifact placeholder (build-ok.txt in zip) per permettere
|
|
all'intero pipeline di completarsi.
|
|
Usare 'ping 127.0.0.1 -n 601 > nul' per mantenere 4 VM attive ~600s
|
|
e osservare la concorrenza prolungata.
|
|
|
|
.PARAMETER RoundTimeoutMinutes
|
|
Minuti massimi di attesa per ogni round prima di interrompere i job rimasti.
|
|
Default: 60.
|
|
#>
|
|
param(
|
|
[int] $Rounds = 3,
|
|
[int] $Parallelism = 4,
|
|
[string] $BuildCommand = 'ping 127.0.0.1 -n 31 > nul',
|
|
[switch] $NoSkipArtifact,
|
|
[int] $RoundTimeoutMinutes = 60
|
|
)
|
|
|
|
Set-StrictMode -Version Latest
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
|
|
& "$scriptDir\Test-CapacityBurnIn.ps1" `
|
|
-RepoUrl 'http://10.10.20.11:3100/ci/burnin-dummy.git' `
|
|
-Branch 'main' `
|
|
-TemplatePath 'F:\CI\Templates\WinBuild2025\WinBuild2025.vmx' `
|
|
-SnapshotName 'BaseClean' `
|
|
-CloneBaseDir 'F:\CI\BuildVMs' `
|
|
-ArtifactBaseDir 'F:\CI\Artifacts' `
|
|
-GuestCredentialTarget 'BuildVMGuest' `
|
|
-GiteaCredentialTarget 'GiteaPAT' `
|
|
-VmrunPath 'C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe' `
|
|
-GuestOS 'Auto' `
|
|
-BuildCommand $BuildCommand `
|
|
-Parallelism $Parallelism `
|
|
-Rounds $Rounds `
|
|
-RoundTimeoutMinutes $RoundTimeoutMinutes `
|
|
$(if (-not $NoSkipArtifact) { '-SkipArtifact' })
|
|
|
|
exit $LASTEXITCODE
|