rustydocs

CI patterns

Affected testing, sharding, JUnit, retries, and monorepo hooks for rusty test.

Affected packages only

# Local pre-push
rusty workspace affected origin/main
rusty test --affected origin/main

# Explicit package list (reviewable argv)
rusty workspace test-plan origin/main
# → # rusty test --affected origin/main
# → rusty test -p api -p worker …
# illustrative CI
- name: Test affected crates
  run: rusty test --affected origin/main -j 8 --reporter junit=junit.xml

Path-only (no reverse dependents):

rusty test --affected-direct origin/main

Sharding

Shards partition the filtered unit plan with (index % n) + 1 == k (1-based k, stable for a fixed plan order).

# Matrix job 1 of 4
rusty test --workspace --shard 1/4 --reporter junit=junit-1.xml

Combine with --affected or -p as needed:

rusty test --affected origin/main --shard 2/3 --retries 1

JUnit

rusty test --workspace --reporter junit=junit.xml

Covers passed runs, failed runs, and compile failures. Classname is the package name.

Retries

rusty test --retries 2

Re-runs failed test binaries up to N extra times (not compile retries). Progress prints retry i/N between attempts.

Jobs and cache in CI

  1. Restore $RUSTY_HOME/cache/ and $RUSTY_HOME/store/ from your cache backend.
  2. rusty fetch (offline-friendly after store restore).
  3. rusty test --affected origin/main -j 8 — compile cache hits show as cache hit.
  4. Optionally pin RUSTY_JOBS instead of -j.

Disable cache for debugging:

RUSTY_TEST_CACHE=0 rusty test -p broken-crate

More monorepo context

See Monorepo workflows and Workspace.

On this page