fix(burn-in): create placeholder artifact when build command produces no output dir

Invoke-RemoteBuild.ps1: when BuildCommand succeeds (exit 0) but GuestArtifactSource
(default: dist) does not exist, instead of silently skipping packaging, now creates a
placeholder 'build-ok.txt' in the artifact output dir and zips it. This ensures
Get-BuildArtifacts.ps1 always finds artifacts.zip regardless of whether the build
produced real output files. Correct for burn-in, smoke, and delay-only build commands.

Start-BurnInTest.ps1: revert default BuildCommand to 'ping 127.0.0.1 -n 31 > nul'
(~30s delay, no artifact output) now that the pipeline handles missing dist gracefully.
The previous 'if not exist dist mkdir dist' workaround is no longer needed.
This commit is contained in:
Simone
2026-05-12 21:23:40 +02:00
parent 8595fbaf45
commit e0b45fc71d
2 changed files with 15 additions and 6 deletions
+8 -1
View File
@@ -449,7 +449,14 @@ try {
} }
$srcPath = Join-Path $workDir $artifactSrc $srcPath = Join-Path $workDir $artifactSrc
if (-not (Test-Path $srcPath)) { if (-not (Test-Path $srcPath)) {
Write-Host "[Build] Artifact source '$srcPath' not found — skipping packaging." # No artifact source — create a placeholder zip so that
# Get-BuildArtifacts succeeds and the full pipeline is exercised.
# This is expected for burn-in / smoke builds that produce no output.
Write-Host "[Build] Artifact source '$srcPath' not found — creating placeholder artifact."
$placeholder = Join-Path $archiveDir 'build-ok.txt'
'No artifact source directory. Build command completed successfully.' |
Out-File -FilePath $placeholder -Encoding UTF8
Compress-Archive -Path $placeholder -DestinationPath $artifactZip -Force
} }
else { else {
$7zip = 'C:\Program Files\7-Zip\7z.exe' $7zip = 'C:\Program Files\7-Zip\7z.exe'
+7 -5
View File
@@ -34,10 +34,12 @@
.PARAMETER BuildCommand .PARAMETER BuildCommand
Comando da eseguire nel guest come passo build (eseguito via cmd /c nel guest). Comando da eseguire nel guest come passo build (eseguito via cmd /c nel guest).
Default: crea la directory dist con un file marker, poi esce 0 — esercita Default: 'ping 127.0.0.1 -n 31 > nul' (attesa ~30s, nessun output reale).
l'intero pipeline inclusa la fase di packaging e artifact collection. Quando il build command non produce la directory dist, Invoke-RemoteBuild crea
Usare 'ping 127.0.0.1 -n 121 > nul' per mantenere 4 VM attive ~120s automaticamente un artifact placeholder (build-ok.txt in zip) per permettere
e osservare la concorrenza senza produrre artifact. 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 .PARAMETER RoundTimeoutMinutes
Minuti massimi di attesa per ogni round prima di interrompere i job rimasti. Minuti massimi di attesa per ogni round prima di interrompere i job rimasti.
@@ -46,7 +48,7 @@
param( param(
[int] $Rounds = 3, [int] $Rounds = 3,
[int] $Parallelism = 4, [int] $Parallelism = 4,
[string] $BuildCommand = 'if not exist dist mkdir dist & echo burnin_ok > dist\marker.txt', [string] $BuildCommand = 'ping 127.0.0.1 -n 31 > nul',
[int] $RoundTimeoutMinutes = 60 [int] $RoundTimeoutMinutes = 60
) )