rustydocs

What ships today

Capability matrix and behavior of the native rusty test runner as implemented.

Status in the matrix is the shipped bar, not marketing. Update this page when behavior lands.

Capability matrix

CapabilityStatusNotes
File tests **/*.test.rsdoneJest-style co-located
File tests tests/**/*.rsdoneIntegration-style tree
rusty.json "test" globs/pathsdoneEmpty array = opt-out
Unit tests ("unit" / lib+bin #[test])doneOpt-in via "test": ["unit", …]
Doctests ("doctest")doneOpt-in; lib root via rustdoc --test
-p / --workspacedoneMulti-package
--affected [base]doneReverse-deps (blast radius)
--affected-direct [base]donePath-touched members only
Native workspace graph for affecteddonenative members only (no cargo metadata)
Parallel compile + rundoneWork-queue workers under one job budget
Shared scheduler (one budget)done-j / RUSTY_JOBS / CARGO_BUILD_JOBS / CPUs
Test binary layer cachedoneCAS-backed unit keys; RUSTY_TEST_CACHE=0 disables
JUnit reporterdone--reporter junit=PATH
CI sharding (--shard k/n)done1-based unit plan partition
Retriesdone--retries N on run failures

Pipeline

select packages (-p / workspace / affected)
  → parse "test" directives
  → plan units (file, unit, doctest)
  → ensure package build (deps + lib layers)
  → parallel rustc --test / rustdoc --test (CAS cache)
  → parallel run pool
  → package + workspace summary (+ optional JUnit)

Selection (shipped)

rusty test                         # cwd member, or sole package
rusty test -p api -p worker
rusty test --workspace
rusty test --affected              # since HEAD~1, + reverse dependents
rusty test --affected origin/main
rusty test --affected-direct main  # path touch only

rusty workspace test-plan [base] prints an equivalent explicit -p list (see Workspace).

Execution flags (shipped)

rusty test --list                  # plan only
rusty test --no-run                # compile only (doctests skipped)
rusty test --fail-fast
rusty test --exact FILTER
rusty test --nocapture             # stream test binary stdio
rusty test -j 8                    # shared compile + run job budget
rusty test --shard 1/4             # CI partition (1-based k of n)
rusty test --reporter junit=out.xml
rusty test --retries 2             # re-run failed binaries
rusty test --release

Filters are substring matches on unit names/paths unless --exact.

Concurrency (shipped)

One budget drives both compile and run pools:

SourcePriority
RUSTY_JOBShighest
-j / --jobs / -jNnext
CARGO_BUILD_JOBSfallback
host CPU countdefault (capped at 32)

Workers claim units from an atomic work queue. Progress lines look like:

rusty test: package api: 3 unit(s), -j 8
compile [api] src/foo.test.rs ... ok (120ms)
compile [api] src/bar.test.rs ... cache hit (2ms)
rusty test: compile cache 1 hit(s), 1 miss(es)
test [api] src/foo.test.rs ... ok (45ms)

Test binary compile cache (shipped)

Each unit is keyed by package identity, source content, crate name, kind, linked package-lib digest (file tests), deps-dir fingerprint, rustc --version, profile, features, and edition. Hits restore the binary (or doctest stamp) from the CAS.

ControlEffect
(default)cache on
RUSTY_TEST_CACHE=0 / false / offskip lookup and store

Planned unit names

KindExample name
Filesrc/foo.test.rs, tests/http.rs
Unitunit:lib:demo, unit:bin:demo
Doctestdoctest:lib:demo

What is explicitly not shipped

  • Silent fallback to cargo test
  • macOS / Windows runners
  • Full nextest config TOML / archive UX
  • Coverage, Miri, sanitizers, fuzzing as first-class rusty test verbs (see roadmap)
  • Package-level “green seal” skip of entire test runs

For configuration details see Configuration. For CI recipes see CI.

On this page