CI: run vitest and cargo test on every PR #61

Merged
jknapp merged 1 commits from ci/run-tests into main 2026-09-23 17:17:15 +00:00
Owner

The PR check (build-app-preview.yml) only built the app. Neither test suite ran in CI.

This adds a test job that runs:

  1. npm ci
  2. npm run build, which type-checks and produces the dist/ that cargo test needs to compile
  3. npx vitest run
  4. cargo test --locked

The job has no needs, so it runs alongside the three platform builds instead of delaying them. A red test fails the PR check, but the preview still publishes.

This matters most for the per-window command lockdown from #60. A command that isn't granted compiles fine and only fails at runtime, so these tests are the guard before merge.

  • Verified: the same steps pass in a fresh clone (vitest 975/975; cargo test 675 + 3).
  • This PR checks itself: it changes the workflow file, so it runs the new job.
  • Docs: CLAUDE.md (Testing) and the lockdown spec are updated to say CI now runs both suites.

🤖 Generated with Claude Code

The PR check (`build-app-preview.yml`) only built the app. Neither test suite ran in CI. This adds a `test` job that runs: 1. `npm ci` 2. `npm run build`, which type-checks and produces the `dist/` that `cargo test` needs to compile 3. `npx vitest run` 4. `cargo test --locked` The job has no `needs`, so it runs alongside the three platform builds instead of delaying them. A red test fails the PR check, but the preview still publishes. This matters most for the per-window command lockdown from #60. A command that isn't granted compiles fine and only fails at runtime, so these tests are the guard before merge. - **Verified:** the same steps pass in a fresh clone (vitest 975/975; cargo test 675 + 3). - **This PR checks itself:** it changes the workflow file, so it runs the new job. - **Docs:** CLAUDE.md (Testing) and the lockdown spec are updated to say CI now runs both suites. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jknapp added 1 commit 2026-09-23 17:09:56 +00:00
ci: run vitest and cargo test on every PR
Secret Scan / scan (push) Successful in 5s
Build App (Preview) / compute-version (pull_request) Successful in 5s
Secret Scan / scan (pull_request) Successful in 6s
Build App (Preview) / create-release (pull_request) Successful in 1s
Build App (Preview) / build-macos (pull_request) Successful in 2m48s
Build App (Preview) / test (pull_request) Successful in 4m41s
Build App (Preview) / build-linux (pull_request) Successful in 5m2s
Build App (Preview) / build-windows (pull_request) Successful in 5m9s
Build App (Preview) / prune-previews (pull_request) Successful in 5s
c09f4c4475
The preview workflow is the PR check, but until now it only built: neither
test suite ran anywhere but a developer's machine. That matters most for the
app-command ACL census from #60. An ungranted command compiles fine and only
fails at runtime, so `cargo test` and vitest's capabilities.test.ts are the
guards that catch it before merge.

The new `test` job runs `npm ci`, `npm run build` (tsc, plus the dist/ that
generate_context! needs), `npx vitest run` and `cargo test --locked`. It has
no `needs`, so it runs alongside the three platform builds instead of
delaying them. Verified in a fresh clone: 975 vitest and 675+3 cargo tests
pass, and the tree stays clean.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
jknapp merged commit 85901d8a80 into main 2026-09-23 17:17:15 +00:00
jknapp deleted branch ci/run-tests 2026-09-23 17:17:15 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: CyberCoveLLC/Triple-C#61