Skip to content

ci: add rust-test job for per-PR Rust test coverage - #724

Merged
danshapiro merged 6 commits into
mainfrom
the-usual/ci-rust-test-coverage
Sep 7, 2026
Merged

ci: add rust-test job for per-PR Rust test coverage#724
danshapiro merged 6 commits into
mainfrom
the-usual/ci-rust-test-coverage

Conversation

@danshapiro

Copy link
Copy Markdown
Owner

Summary

Adds a parallel rust-test job to rust-clippy.yml that runs cargo test --workspace --locked + the Tauri app-bound server-spawn smoke on every PR.

What the job does

  • Reuses the same pinned toolchain (1.96.0), Swatinem/rust-cache@v2, and Tauri GTK/WebKit apt deps as the clippy job
  • Adds npm ci (required because freshell-freshagent and freshell-ws tests spawn MCP servers that resolve tsx from node_modules)
  • Explicitly builds freshell-server so the Tauri smoke cannot soft-skip
  • Sets FRESHELL_SERVER_BIN to the built binary path for deterministic non-vacuity
  • Runs cargo test --workspace --locked
  • Runs the Tauri smoke with --nocapture + grep enforcement so CI turns red if the smoke soft-skips or the test fails

Why

Today, only freshell-protocol and freshell-terminal run in CI (via port-contract.yml). The other ~11 Rust crates have zero CI test coverage. This PR wires the full workspace test suite into CI as a parallel job alongside clippy, so required-check wall time is unaffected.

Relation to PR #699

PR #699 ("Retire the Node server") already modifies rust-clippy.yml to add cargo test --workspace --locked, but it's stuck (CONFLICTING, failing clippy, 1000+ files, no reviews). This PR extracts just the CI workflow change so it lands independently. When PR #699 merges, it should drop rust-clippy.yml from its diff.

Post-merge follow-up

Making rust-test a required merge gate requires a post-merge ruleset amendment (ruleset 14473229). That is a separate user follow-up, not part of this PR.

Test plan

  • rust-test job passes on this PR
  • CI log shows "using server binary:" (Tauri smoke non-vacuous, enforced by grep)
  • clippy job still passes (no changes to existing job)

…ll path

The shared `sleeper_cli_spec` in `tests/common/mod.rs` used a
`{name}-{pid}`-only script path, so parallel tests in the same binary
that call `sleeper_cli_spec("claude")` share ONE path. When test 2's
`fs::write` races test 1's still-in-flight `execve` of the same file,
Linux holds deny-write during exec and the write fails with ETXTBSY
("Text file busy"). This was already fixed in the local copy in
`cross_kind_liveness.rs` (commit 1839b11) but not in the shared
`common/mod.rs` version used by 17 other test files.

Fix: add a global `AtomicU64` counter to the script filename so every
call gets a fresh path. Verified with the existing
`sleeper_cli_spec_paths_are_unique_per_call` test pattern.
@danshapiro
danshapiro merged commit 951f750 into main Sep 7, 2026
5 of 8 checks passed
pull Bot pushed a commit to HinchK/freshell that referenced this pull request Sep 7, 2026
… add regression test

Delta review of PR danshapiro#724 found four actionable findings:

1. Missing --no-fail-fast: one flake aborted the entire workspace test run,
   hiding all later test binaries. Add --no-fail-fast so all binaries run.

2. restore_spawn_gate.rs had the same ETXTBSY race as common/mod.rs (shared
   {name}-{pid} path, 10 parallel tests). Add AtomicU64 counter matching
   the common/mod.rs fix.

3. No regression test for the shared common::sleeper_cli_spec uniqueness.
   Add shared_sleeper_cli_spec_paths_are_unique_per_call in pane_ledger_triggers
   matching the existing test in cross_kind_liveness.rs (commit 1839b11).

Kata 299r tracks the auto_resume_e2e timing flakes that block rust-test
from going green on 4-core CI runners.
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