format_run_artifact_footer

Function format_run_artifact_footer 

Source
pub fn format_run_artifact_footer(runs_root: &Path, since: SystemTime) -> String
Expand description

Render the cargo ktstr test post-run footer: for each run directory written at or after since, name every FAILED test and the concrete path to each of its artifacts (failure dump, auto-repro dump, stats sidecar, wprof trace), plus a per-dir count of stats sidecars and wprof traces.

Returns the empty string when no run directory under runs_root holds fresh artifacts — a host-only run (no VM tests) writes no sidecars, so there is nothing to point at and the caller emits no footer.

A test is listed FAILED when it left a failure dump (real or placeholder) or an is_fail stats sidecar. This is NOT an exhaustive failure list: a failure that writes neither — a builder.build() / vm.run() error, a pre-build host error (kvm probe, kernel/scheduler resolve, validation), a host panic, or an unparseable guest result — leaves no on-disk artifact and no entry here. The caller (cargo_ktstr::run_cargo) treats nextest’s own exit status as the authoritative pass/fail signal and notes, when nextest reports failures, that any failure without an entry left no artifact.

This replaces a directory + *.glob legend that carried no test attribution: a reused run directory mixes artifacts from many tests (and, before the mtime gate, prior runs), so a glob legend pointed an operator at the directory and left them to guess which *.failure-dump.json belonged to the test that just failed.