A dedicated nextest executor for teams that use cargo nextest as
their primary test runner.
| ID | Owner | Status |
|---|---|---|
| NEXTEST | eddacraft | Proposed |
cargo nextest is the de-facto choice for serious Rust teams running
tests in CI: parallel test execution, JUnit/XML reports, partition
support for sharded CI, archive-and-run for cross-host test execution,
better failure summarisation than cargo test. Spec §6.11 makes it a
first-class test runner.
v0.1's test executor opportunistically uses nextest when available
(per the original 03-v0.2-polish notes). This module formalises the
relationship: a dedicated nextest executor with nextest-specific
options, plus an opt-in plugin config that makes nx test route to
nextest automatically when configured.
This module absorbs the cargo-nextest items from the original
03-v0.2-polish module (now refactored away).
nextest executor:
- Wraps
cargo nextest run. - Cacheable; outputs follow 04-cache-semantics
—
[]for result-only mode, junit/xml report directory for reporting mode. - Inferred per Rust crate by 03-target-inference.
- Cargo package name pinned via
-p <pkg>(inherits v0.1.1 fix).
Nextest-specific options (spec §6.11):
| Option | Behaviour |
|---|---|
profile |
--profile <name> (nextest profile, distinct from cargo profile) |
partition |
--partition <spec> for sharded CI |
archiveFile |
--archive-file <path> for cross-host runs |
workspaceRemap |
--workspace-remap <path> for archive-and-run |
noFailFast |
--no-fail-fast |
features / allFeatures / noDefaultFeatures |
Inherits the 05-cargo-features option set |
target |
Rust target triple (inherits 05) |
toolchain |
Inherits 06-toolchain-awareness |
Options outside this allowlist are dropped at the cargo-args boundary —
same allowlist convention as v0.1.1's buildCargoArgs fix.
Plugin configuration option:
{
"plugins": [
{
"plugin": "@eddacraft/nxrust",
"options": {
"testRunner": "nextest"
}
}
]
}When testRunner = "nextest", nx test <crate> invokes the nextest
executor instead of the test executor. Per-crate override via
package.metadata.nxrust.test-runner = "nextest".
Per-crate metadata override (spec §6.1):
[package.metadata.nxrust]
test-runner = "nextest"Per-crate value overrides plugin-level setting.
- Replacing the
testexecutor. Both remain;testRunneris a selector. Spec open question 1 is deferred — no replacement until consumer feedback says so. - Bench runner integration.
benchis its own thing (07-generators + Criterion). nextest'sarchivesubcommand as a separate executor. ThearchiveFileoption onrunis sufficient for v0.3; a dedicatednextest-archiveexecutor is a v0.4+ ask.- Test report parsing or aggregation. The plugin runs nextest; downstream CI consumes the report.
cargo nextestbinary on PATH (cargo install cargo-nextest --locked, or the official nextest pre-built binary release).- 03-target-inference — inferred
nextesttarget on crates with test code. - 05-cargo-features — shared feature/profile/target/toolchain options.
- 04-cache-semantics — cache rules.
- 14-diagnostics — missing-tool message.
nextestexecutor.testRunnerplugin option ("cargo"default,"nextest"opt-in).package.metadata.nxrust.test-runnerper-crate override.- A shared cargo-args builder between
testandnextestto keep option translation consistent (D-PL2 inheritance — one source of truth for cargo-test/nextest option mapping).
- Single source of truth for cargo-test/nextest option translation.
The
testandnextestexecutors share an option-mapping module; divergence between them is a bug. - Tool-presence aware. Missing
cargo-nextest⇒ structured diagnostic via 14-diagnostics, never raw shell error. - Cache rules inherit from 04-cache-semantics.
nextest's archive and junit files are outputs only when configured. - Option allowlist enforced. Inherits v0.1.1 fix — unknown options dropped at cargo-args boundary.
testRunner = "nextest"does not silently change behaviour. When the option is set, the executor used is part ofnx show projectoutput.
Promote individual Work Items to Ready when:
- A real consumer asks for
nextest(per D-007). - The consumer's nextest usage is captured (which options, which profile, which CI shape).
- A Work Item is drafted.
No work items yet — module is Proposed. Items promote individually on real-consumer asks per D-007.
| Risk | Impact | Likelihood | Mitigation |
|---|---|---|---|
cargo-nextest executor diverges from test executor over time |
medium | medium | Share the cargo-arg builder and options-allowlist logic between the two; one source of truth |
Switching testRunner mid-line changes cache hits unexpectedly |
medium | medium | Executor identity participates in cache key (via Nx); document the cache invalidation on switch |
| Nextest profile name collides with cargo profile name | low | medium | Distinct option names (profile for nextest profile; cargoProfile if both needed); document the distinction |
Missing cargo-nextest on the consumer's CI runner |
high | medium | Diagnostic on first invocation; consumer installs in their CI setup (documented in 09-supply-chain-style install hint) |
- D-NT1:
nextestis a sibling executor totest, not a replacement. Spec open question 1 (replace vs sibling) stays open. Accepted. - D-NT2:
testRunnerplugin option +package.metadata.nxrust.test-runnerper-crate override are the routing mechanism. Accepted. - D-NT3:
testandnextestshare a single cargo-args builder. Accepted.
- Should
nextestreplacetestonce stable? Replacing breaks consumers without nextest installed; keeping both grows the surface. Spec open question 1. Defer to promotion + consumer feedback. - Default nextest profile —
default(nextest's own) orci?defaultis safer;ciis what most consumers want. Document the choice; configurable via option. - Should
archiveFileoutput participate in caching? Archives are large; probably yes with explicit opt-in. - Should the
nextest-archivesubcommand be a separate executor for the archive-create step? Or keep within therunexecutor? Spec §6.11 listsarchive-fileas an option; one executor for v0.3.