runs_root

Function runs_root 

Source
pub fn runs_root() -> PathBuf
Expand description

Resolve the parent directory that holds all test-run subdirectories.

Resolution order:

  1. crate::KTSTR_RUNS_ROOT_ENV (absolute) — the cargo ktstr orchestrator stamps this once at startup so its footer / stats / replay reads AND the child test processes’ sidecar writes resolve the SAME directory regardless of CWD. This is the primary path under cargo ktstr.
  2. {CARGO_TARGET_DIR}/ktstr when that env is set non-empty.
  3. target/ktstr (CWD-relative) — the raw cargo nextest run fallback. CWD-relative is fragile across a Cargo workspace (the test binary’s CWD is the package dir, which differs from a workspace-root invocation), which is exactly why the orchestrator pins the absolute override above; raw nextest has no footer to mismatch, so the fallback is acceptable there.

Used by cargo ktstr stats / replay and the post-run footer to enumerate runs without reconstructing a specific run key.