prefer-nextest-for-heavy-rust-tests
What it flags
Flags heavy-looking Rust test jobs that still run cargo test without visible cargo-nextest adoption.
Why it matters
cargo-nextest is designed as a faster CI-oriented Rust test runner. It can improve wall-clock time for larger workspaces, multi-binary test suites, and integration-heavy jobs by using a different execution model from plain cargo test.
The rule does not suggest blindly replacing every Rust test command. Small crates and simple unit-test jobs may not benefit enough to justify a migration.
Current heuristic
The rule requires all of the following:
- the repository has a root
Cargo.toml - the repository does not already show
nextest.toml,.config/nextest.toml, ornextestin the root Cargo manifest - the workflow does not already run
cargo nextest,nextest run, or installcargo-nextest - a job visibly runs
cargo test - the
cargo teststep is not onlycargo test --doc - the job or repository has a heavy Rust test signal
Heavy Rust test signals include:
cargo test --workspacecargo test --allcargo test --all-featurescargo test --testscargo test --benches- a matrix job
- service containers
- job names such as
integration,e2e,slow, orfull - a Cargo workspace with more than one visible member, or an uncounted workspace
When to ignore it
Ignore this finding when:
- the Rust test suite is already fast enough
cargo testbehavior is intentionally required- doctests are the only test target
cargo-nextestdoes not support the repository’s required test behavior- migration risk is higher than the expected CI time savings
Suggested verification
- Compare
cargo testandcargo nextest runwall-clock time on the same runner - Use equivalent workspace, package, feature, and target flags
- Keep a separate
cargo test --docstep if doctests matter - Check that failure output and flaky-test behavior remain acceptable