Skip to content

ci: gate the vitest suite in CI - #113

Closed
myobie wants to merge 1 commit into
mainfrom
ci/vitest-gate
Closed

ci: gate the vitest suite in CI#113
myobie wants to merge 1 commit into
mainfrom
ci/vitest-gate

Conversation

@myobie

@myobie myobie commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Gate the vitest suite in CI

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,
both green under nix build but red under npm test:

  1. feat: exit-time cleanup of dead non-permanent sessions #111 exit-reap × parity Add Nix flake and fish shell completions #1feat: exit-time cleanup of dead non-permanent sessions #111 (exit-time cleanup of dead
    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 the
    pre-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 build never ran either test.
  2. Add pty completions <shell> generator (fish/bash/zsh, SSOT, dynamic sessions) #106 completions help-docs drift — the completions dispatch case was
    never added to the help docs; help.test.ts's "every dispatch case is
    documented" check fails.

What this adds

.github/workflows/test.yml: on pull_request + push-to-main
checkoutsetup-node@v4 (Node 22, matching flake.nix nodejs_22) →
npm cinpm run build (the suite exercises dist/cli.js + dist/server.js)
npm test.

⚠️ This gate is RED on current main — by design

It will fail until the 4 known vitest failures are fixed (3 post-exit parity

  • 1 completions). Those fixes are pending product/routing decisions
    (reap-vs-preserve default; completions docs) — tracked separately. A red check
    here is precisely the gate doing its job: catching what nix build couldn't.
    Merge once the underlying fixes make it green.

Scope kept minimal (vitest gate only, as requested). A typecheck job could be
a small follow-up.

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.
@myobie

myobie commented Jul 21, 2026

Copy link
Copy Markdown
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 myobie closed this Jul 21, 2026
@myobie
myobie deleted the ci/vitest-gate branch July 21, 2026 10:27
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.
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