Skip to content

Feat/smoke verdict - #9

Merged
thatplatypus merged 9 commits into
mainfrom
feat/smoke-verdict
Sep 27, 2026
Merged

thatplatypus merged 9 commits into
mainfrom
feat/smoke-verdict

Conversation

@thatplatypus

Copy link
Copy Markdown
Contributor

No description provided.

Stop-SmokeApp's macOS quit left a stale $LASTEXITCODE from pkill (exit
1 when the process was already gone), which GitHub's pwsh step wrapper
turns into a failed step; every macOS legacy pass was failing its own
launcher step. Reset $LASTEXITCODE after Stop-SmokeApp and exit 0 after
a recorded run, since the verdict step is what should judge pass/fail,
not a leftover native tool exit code.

Also bound the macOS quit with an AppleScript timeout and a SIGKILL
fallback so a hung app cannot stall the step, clear stale
app-*.log/result.json/run.json and the extraction work directory at
the start of a run so a retry in the same job cannot read a prior
run's leftovers, and pipe unzip/xattr/chmod output to Out-Null in
Find-SmokeTarget so it cannot leak into the function's return value.

Extract the post-loop mode/timedOut/legacyAlive/exitCode decision into
a pure Get-SmokeRunOutcome function with its own Pester coverage
(exited-before-start, legacy-alive, start-line-seen-late,
verdict-mode-timeout, and per-platform exit code handling), and switch
the existing tests in this file to TestDrive: for temp paths.
Run the verdict step even when the launch step failed
(if: !cancelled()), and when run.json itself is missing, report FAILED
with an explicit reason (the launcher never got as far as recording a
run) instead of silently defaulting to verdict mode with null fields.

Print the last 50 lines of app-stdout.log and app-stderr.log inside
::group:: blocks whenever the verdict fails, so a failed run's output
is visible in the job log without opening artifacts.

Move Set-StrictMode from file scope to the top of each function in
SmokeVerdict.ps1: dot-sourcing the file (Hermes CI does) was turning
strict mode on in the caller's own scope.

Document the run.json contract (mode, exitCode, timedOut, legacyAlive)
on the smoke-verdict action's output_dir input and in
Invoke-SmokeVerdict.ps1's header comment.

Save and restore $env:GITHUB_OUTPUT / $env:GITHUB_STEP_SUMMARY around
each test instead of removing them, since a real runner already has
both set, and switch temp directories to TestDrive:.
Add a launcher-e2e job (ubuntu-latest, macos-latest) that runs the
real ./actions/smoke-test composite action, so GitHub's own pwsh step
wrapper applies, against three fixtures per OS with their own
releases_dir/output_dir: a legacy app that never speaks the smoke
protocol, and smoke-aware apps that report PASSED and FAILED. Asserts
each fixture's result output in a final step that fails the job on any
mismatch.

Add -SkipPublisherCheck to the Install-Module Pester fallback, since
the in-box Pester 3.4 on windows-latest is signed by a publisher not
already trusted on the runner and otherwise blocks the install.
@thatplatypus
thatplatypus merged commit 586f3f5 into main Sep 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant