Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ jobs:
--root "$unpackedRoot" `
--max-files 250

- name: Assert launch smoke rejects missing unpacked backend entry
- name: Assert launch smoke reports missing unpacked runtime file
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
Expand All @@ -240,22 +240,22 @@ jobs:
Copy-Item -Recurse -Force (Join-Path $cleanInstallDir "*") $brokenInstallDir

$brokenAppExe = Join-Path $brokenInstallDir (Split-Path -Leaf $cleanAppExe)
$removedBackendEntry = Join-Path $brokenInstallDir "resources/app.asar.unpacked/apps/server/dist/bin.mjs"
if (-not (Test-Path $removedBackendEntry)) {
throw "Negative launch-smoke fixture could not find packaged backend entry to remove: $removedBackendEntry"
$removedRuntimeFile = Join-Path $brokenInstallDir "resources/app.asar.unpacked/apps/server/dist/bin.mjs"
if (-not (Test-Path $removedRuntimeFile)) {
throw "Negative launch-smoke fixture could not find packaged runtime file to remove: $removedRuntimeFile"
}
Remove-Item -Force $removedBackendEntry
Remove-Item -Force $removedRuntimeFile

$output = & node scripts/desktop-launch-smoke.mjs --command "$brokenAppExe" --timeout-ms 45000 --stability-ms 1000 2>&1
$exitCode = $LASTEXITCODE
$outputText = $output | Out-String
$output | ForEach-Object { Write-Host $_ }

if ($exitCode -eq 0) {
throw "Launch smoke passed against a packaged artifact with the backend entry removed; the gate is not trustworthy."
throw "Launch smoke passed against a packaged artifact with a required unpacked runtime file removed; the gate is not trustworthy."
}
if ($outputText -notmatch "(?i)(apps/server/dist/bin\.mjs|missing server entry|backend|timed out)") {
throw "Launch smoke failed against the broken packaged artifact, but did not report the expected missing backend entry."
if ($outputText -notmatch "(?i)(installation is incomplete|apps/server/dist/bin\.mjs)") {
throw "Launch smoke failed against the broken packaged artifact, but did not report the expected incomplete-installation diagnostic."
}

Write-Host "Launch smoke rejected the deliberately broken packaged artifact with exit code $exitCode."
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/reusable-build-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ jobs:
--root "$unpackedRoot" `
--max-files 250

- name: Assert launch smoke rejects missing unpacked backend entry
- name: Assert launch smoke reports missing unpacked runtime file
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
Expand All @@ -485,22 +485,22 @@ jobs:
Copy-Item -Recurse -Force (Join-Path $cleanInstallDir "*") $brokenInstallDir

$brokenAppExe = Join-Path $brokenInstallDir (Split-Path -Leaf $cleanAppExe)
$removedBackendEntry = Join-Path $brokenInstallDir "resources/app.asar.unpacked/apps/server/dist/bin.mjs"
if (-not (Test-Path $removedBackendEntry)) {
throw "Negative launch-smoke fixture could not find packaged backend entry to remove: $removedBackendEntry"
$removedRuntimeFile = Join-Path $brokenInstallDir "resources/app.asar.unpacked/apps/server/dist/bin.mjs"
if (-not (Test-Path $removedRuntimeFile)) {
throw "Negative launch-smoke fixture could not find packaged runtime file to remove: $removedRuntimeFile"
}
Remove-Item -Force $removedBackendEntry
Remove-Item -Force $removedRuntimeFile

$output = & node scripts/desktop-launch-smoke.mjs --command "$brokenAppExe" --timeout-ms 45000 --stability-ms 1000 2>&1
$exitCode = $LASTEXITCODE
$outputText = $output | Out-String
$output | ForEach-Object { Write-Host $_ }

if ($exitCode -eq 0) {
throw "Launch smoke passed against a packaged artifact with the backend entry removed; the gate is not trustworthy."
throw "Launch smoke passed against a packaged artifact with a required unpacked runtime file removed; the gate is not trustworthy."
}
if ($outputText -notmatch "(?i)(apps/server/dist/bin\.mjs|missing server entry|backend|timed out)") {
throw "Launch smoke failed against the broken packaged artifact, but did not report the expected missing backend entry."
if ($outputText -notmatch "(?i)(installation is incomplete|apps/server/dist/bin\.mjs)") {
throw "Launch smoke failed against the broken packaged artifact, but did not report the expected incomplete-installation diagnostic."
}

Write-Host "Launch smoke rejected the deliberately broken packaged artifact with exit code $exitCode."
Expand Down
Loading
Loading