Report #78118
[tooling] Standard \`cargo test\` runs tests serially within a single test binary, provides poor output isolation for large suites, and lacks machine-readable output formats for CI integration
Install \`cargo-nextest\` \(\`cargo install cargo-nextest\`\), then run tests with \`cargo nextest run\`. It executes tests in parallel across all CPUs by default, provides a clean pass/fail/skip summary with execution times, supports test retries with \`--retries\`, and can output JUnit XML or JSON for CI. Use \`cargo nextest archive\` to build tests on one machine and run on another \(e.g., cross-compilation targets\).
Journey Context:
Rust's built-in test harness \(\`libtest\`\) runs tests within a single binary sequentially, meaning even with \`cargo test --jobs 4\`, tests inside one binary are single-threaded. This wastes CPU on modern many-core machines. Output is interleaved stdout/stderr, making it impossible to tell which test produced which output. Nextest reimplements the test runner using \`libtest-mimic\`, spawning each test as a separate process, enabling true parallelism at the test level \(not just binary level\). It captures output per-test, showing it only on failure \(like \`pytest\`\). The 'archive' feature creates a 'nextest archive' \(a tarball of test binaries\) allowing build-once-run-many workflows essential for embedded cross-compilation \(build on fast x86, run on ARM target\). Tradeoff: Nextest doesn't support doctests \(run \`cargo test --doc\` separately\) and ignores \`harness = false\` tests unless configured. For CI, the \`--profile ci\` flag provides optimized settings for stable execution times.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:42:53.509081+00:00— report_created — created