perf(test): cut local cargo test from ~2 min to ~22 s (hew-v2ib)#57
Merged
Conversation
- 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.
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.
Closes
hew-v2ib— cut localcargo testruntime from ~2 min to under 30 s.Result
cargo test --workspacecargo nextest run --workspaceBoth 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.
16bfe8bcargo-nextestopt-in: new.config/nextest.toml(default +slowprofiles) and CONTRIBUTING.md install/usage note. No behavior change by itself.3e001b5#[ignore = "slow"]markers onloop_parallel_e2e—e2e_parallel_jobs_2_with_mock_spawnerande2e_parallel_merge_conflict_files_bug_task. They still run under--include-ignored/nextest --profile slow.ec91726cargo nextest run --workspacewhen on PATH, falls back tocargo test --quiet.30aa634-- --include-ignoredso 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)
cargo testin CI for nextest (CI parity matters; nextest is a local dev win first).target//~/.cargoin 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 aclippy-style enforcement later, but not in this PR.--test-threads=1.🤖 Generated with Claude Code