Add CI workflow to run Pester suite on self-hosted Windows runner - #222
Add CI workflow to run Pester suite on self-hosted Windows runner#222J-MaFf wants to merge 4 commits into
Conversation
Adds .github/workflows/test.yml: runs the non-integration Pester suite (./tests/run-tests.ps1) on every pull request, using the self-hosted Windows runner already connected to this repo (GH-RUNNER-FLAUI) but previously unused by any workflow. Bootstraps the Pester 5+ module if missing (idempotent), fails the job on any test failure (no swallowed exit codes), and caps at timeout-minutes: 20 - there is exactly one connected runner, so an unbounded hang would block every subsequent workflow run indefinitely. Does NOT add a required status check. While blueprinting this, running the full suite directly on a real Windows dev machine reproduced a real failure + hang in switch_to_main's "Should fail when there are uncommitted changes" test (apparent cross-file state pollution across the 10 test files) - gating merges now would risk blocking everything on a suite that isn't provably stable. That diagnosis is tracked separately (bead gitconfig-cm6). - Added: .github/workflows/test.yml - Modified: CHANGELOG.md, STATUS.md - Dependencies: none new; Pester module bootstrap runs on the runner at job time - Tested: forge generator/evaluator loop (spec: specs/archive/add-pester-ci-workflow.md) - all 9 acceptance criteria (C1-C9, C-final) passed round 1, including the evaluator executing the Pester-bootstrap step's script directly in real pwsh for both the "already installed" and "missing" branches, and confirming exit-code propagation empirically. Did not trigger an actual workflow run (needs a real PR against the self-hosted runner) - verified via YAML parse (yaml.safe_load) and manual trace instead. Fixes #221 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Self-reviewRe-read the full diff (
One caveat worth flagging directly rather than papering over: I have not seen this workflow actually execute on No other issues found; nothing to fix in a follow-up commit beyond watching that first real run. |
… -PassThru
Discovered by this PR's own new CI workflow: the very first real run on
GH-RUNNER-FLAUI showed 61 genuine Pester failures but the job reported
success.
Root cause: Run.PassThru in the Pester configuration was wired to the
script's own -PassThru switch (default $false), but Invoke-Pester only
returns a results object when Run.PassThru is $true. Called without
-PassThru - the script's own primary documented usage
(".\run-tests.ps1") - $results was $null, so
`$results.FailedCount -gt 0` silently evaluated to $false regardless of
actual failures, and the script always exit 0'd.
Run.PassThru is now always $true internally so the exit-code check has
real data; the caller-facing -PassThru switch's contract (an unrelated,
separately pre-existing gap - the script never actually emitted
$results to its own caller either way) is unaffected by this change.
- Modified: tests/run-tests.ps1
- Tested: parses cleanly (0 syntax errors via
[Parser]::ParseFile); a scoped zero-match run confirms exit 0 is still
correct for a clean pass; a deliberately-failing single test confirms
exit 1 is now correctly produced (previously would have been 0); this
PR's own re-triggered CI workflow run against the real 61 pre-existing
failures is the authoritative end-to-end confirmation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Follow-up: found and fixed a real bug via this PR's own first CI runThe first real trigger of this workflow on Root cause was in Fixed in 1db18cf: Verified on the real runner, not just locally: re-triggered the workflow after the fix — same 61 pre-existing failures, but the job now correctly shows Net effect: this PR's checks tab will show red, correctly — those 61 failures are real and pre-existing (unrelated to this PR's own changes), and are the subject of the separately-tracked flakiness investigation (bead |
Fixes #221
Changes
.github/workflows/test.yml: runs the non-integration Pester suite (./tests/run-tests.ps1) on every pull request, using the self-hosted Windows runner already connected to this repo (GH-RUNNER-FLAUI) but previously unused by any workflow.Pester5+ module if missing (idempotent — no-op if already present).timeout-minutes: 20— there's exactly one connected runner, so an unbounded hang would block every subsequent workflow run indefinitely.switch_to_main's "Should fail when there are uncommitted changes" test (apparent cross-file state pollution across the 10 test files). Gating merges now would risk blocking everything on a suite that isn't provably stable — that diagnosis is tracked separately as beadgitconfig-cm6.CHANGELOG.md/STATUS.mdupdated.Spec:
specs/archive/add-pester-ci-workflow.md(blueprint → forge, same as #220).Testing
pwshfor both the "already installed" and "missing" branches, and empirically confirmed non-zero exit-code propagation fromrun-tests.ps1through thepwshshell step.GH-RUNNER-FLAUIactually picks up the job and has the toolchain it needs (pwshitself is assumed present per the spec — the workflow bootstraps thePestermodule but not the interpreter).🤖 Generated with Claude Code