ci: gate the vitest suite in CI - #113
Closed
myobie wants to merge 1 commit into
Closed
Conversation
The only CI on push/PR was `nix build` (.github/workflows/nix.yml) — the vitest suite never ran in CI. That is how two breaks reached main unseen: the #111 exit-reap regression against the post-exit parity contract (parity #1) and the #106 `completions` help-docs drift. Both are green under `nix build` and red under `npm test`. Add .github/workflows/test.yml: on pull_request + push-to-main, checkout -> setup-node 22 (matches flake.nix nodejs_22) -> npm ci -> npm run build (the suite exercises dist/cli.js + dist/server.js) -> npm test. NOTE: this gate runs RED on the current main until the 4 known vitest failures land fixes (3 post-exit parity + 1 completions) — which is precisely the gate doing its job.
Collaborator
Author
|
Superseded by #114 — the vitest CI gate is folded into that hotfix PR (which also un-breaks the parity contract + adds the shell/claude-stub setup the gate needs to go green). Closing this standalone gate PR. |
myobie
added a commit
that referenced
this pull request
Jul 21, 2026
…k parity + wire vitest CI (#114) Un-breaks the post-exit parity contract that #111 (exit-reap) broke on main, per Nathan's call: make reap-vs-preserve-on-exit CONFIGURABLE rather than a fixed default. - PTY_REAP_ON_EXIT env knob (network/global; the daemon inherits it via spawn.ts) sets the default: false/0/no/off -> preserve, unset/else -> reap (shipped default). Per-session keep=true (force preserve) / --ephemeral (force reap) override it. shouldReapAtExit gains an OPTIONAL defaultReap param (defaults to reapOnExitDefault()) so the re-exported 2-arg API (relay/layout/supervisors) stays backward-compatible. - parity #1 now asserts BOTH modes (preserve keeps the final screen; reap reaps). exit-reap.test.ts keeps the reap-default suite + adds a preserve-mode block. isolate-env.ts scrubs PTY_REAP_ON_EXIT for a deterministic default. - help.test.ts: completions -> NON_COMMAND_CASES (fixes pre-existing #106 help drift; completions ships its own lightweight usage, not the strict per-subcommand format). - CI: add .github/workflows/test.yml gating the vitest suite (Node 22, matches flake.nix) on PR + push-to-main. Installs the test-only binaries ubuntu-latest lacks (zsh/fish for shells.test.ts; a no-op claude stub for restart-guardrail). The push CI was Nix-build-only, which is how both breaks reached main invisibly. Supersedes #113. - Docs: README "Session lifecycle and cleanup" + CHANGELOG rewritten for the configurable setting. Full suite green: 1408 passed, 21 pre-existing env-gated skips.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gate the vitest suite in CI
The only CI on push/PR was
nix build(.github/workflows/nix.yml) — thevitest suite never ran in CI. That is how two breaks reached
mainunseen,both green under
nix buildbut red undernpm test:non-permanent sessions) makes default sessions reap themselves at exit, so
peek-after-exit returns "not found". fix(cli): run --force creates a nested session inside a pty (parity R1 #4) #112's parity Add Nix flake and fish shell completions #1 (asserting thepre-feat: exit-time cleanup of dead non-permanent sessions #111 post-exit persistence) merged right after and now fails. Neither
PR's CI saw the other, and
nix buildnever ran either test.pty completions <shell>generator (fish/bash/zsh, SSOT, dynamic sessions) #106completionshelp-docs drift — thecompletionsdispatch case wasnever added to the help docs;
help.test.ts's "every dispatch case isdocumented" check fails.
What this adds
.github/workflows/test.yml: onpull_request+ push-to-main→checkout→setup-node@v4(Node 22, matchingflake.nixnodejs_22) →npm ci→npm run build(the suite exercisesdist/cli.js+dist/server.js)→
npm test.main— by designIt will fail until the 4 known vitest failures are fixed (3 post-exit parity
completions). Those fixes are pending product/routing decisions(reap-vs-preserve default;
completionsdocs) — tracked separately. A red checkhere is precisely the gate doing its job: catching what
nix buildcouldn't.Merge once the underlying fixes make it green.
Scope kept minimal (vitest gate only, as requested). A
typecheckjob could bea small follow-up.