Skip to content

perf(test): cut local cargo test from ~2 min to ~22 s (hew-v2ib)#57

Merged
droidnoob merged 4 commits into
mainfrom
perf/test-runtime-cut
May 29, 2026
Merged

perf(test): cut local cargo test from ~2 min to ~22 s (hew-v2ib)#57
droidnoob merged 4 commits into
mainfrom
perf/test-runtime-cut

Conversation

@droidnoob
Copy link
Copy Markdown
Owner

Closes hew-v2ib — cut local cargo test runtime from ~2 min to under 30 s.

Result

runner wall tests skipped (slow)
cargo test --workspace 22.3 s all 0 (markers respected)
cargo nextest run --workspace 18.0 s 1019 passed 2

Both well under the 30 s target. Pre-commit gate becomes a non-event.

What changed

5 files, +86 / -4, four atomic commits — any one is revertable in isolation if it bites.

commit what
16bfe8b cargo-nextest opt-in: new .config/nextest.toml (default + slow profiles) and CONTRIBUTING.md install/usage note. No behavior change by itself.
3e001b5 Two #[ignore = "slow"] markers on loop_parallel_e2ee2e_parallel_jobs_2_with_mock_spawner and e2e_parallel_merge_conflict_files_bug_task. They still run under --include-ignored / nextest --profile slow.
ec91726 Pre-commit hook prefers cargo nextest run --workspace when on PATH, falls back to cargo test --quiet.
30aa634 CI gains -- --include-ignored so the #[ignore] tests still gate every PR. Coverage is not reduced — it's relocated.

CI parity

CI runs the full suite including the #[ignore = "slow"] tests. The fast-local / strict-CI split is the whole point: developers don't pay the slow-test tax on every commit, but no PR merges without proving them green.

CI wall is unchanged-to-slightly-longer (the 2 #[ignore] tests still cost their ~10 s, plus build dominates anyway). Optimizing CI is a separate concern; this PR is purely the local UX.

Out of scope (not done)

  • Rewriting any test fixture or harness.
  • Dropping cargo test in CI for nextest (CI parity matters; nextest is a local dev win first).
  • Caching target/ / ~/.cargo in CI (separate workflow optimization).

Risks

  • #[ignore] discipline: if a future contributor adds a slow test without #[ignore = "slow"], the pre-commit run gets slow again. Worth a clippy-style enforcement later, but not in this PR.
  • Nextest flake amplification: parallel execution exposes races more aggressively. Anything that surfaces should be fixed, not papered over with --test-threads=1.

🤖 Generated with Claude Code

droidnoob added 4 commits May 30, 2026 03:05
- Ship `.config/nextest.toml` with a default + `slow` profile so the
  workspace runs the same way for everyone who installs nextest.
- Document install + invocation in CONTRIBUTING.md alongside the
  existing `cargo test` workflow, including the `--ignored` periodic
  sweep convention.

Refs hew-v2ib.
Both tests drive the full parallel-loop runner against a real git repo
(seed + worker branches + merge-back), which is exactly the kind of
e2e the periodic sweep covers — not the pre-commit gate. Skipping them
by default keeps the inner-loop signal fast; CI runs them via
`--include-ignored`.

Refs hew-v2ib.
Falls back to `cargo test --quiet` so contributors without nextest stay
unblocked. On a warm cache nextest takes ~17s vs ~26s for `cargo test`
on this workspace — pre-commit becomes meaningfully cheaper for the
people who installed it without forcing a new dep on everyone else.

Refs hew-v2ib.
The pre-commit hook and default `cargo test` skip `#[ignore = "slow"]`
tests for inner-loop speed. CI is the only place those tests have to
run, so add `--include-ignored` to the matrix invocation.

Refs hew-v2ib.
@droidnoob droidnoob merged commit c12212d into main May 29, 2026
14 checks passed
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