feat(just): coverage report and floor
Coverage is a tripwire, not a correctness oracle: the proofs, the property tests, the GnuCash cross-check and mutation testing answer whether the books are right; a line/branch report answers whether a test still reaches the code it used to. This adds that measurement, pinned in mise.toml like every other tool: cargo-llvm-cov 0.9.1, and the llvm-tools component on the pinned nightly because branch coverage is nightly-only (-Zcoverage-options=branch). `just coverage` runs each crate's own suite instrumented (core and store separately, so one crate's dev-dependency code does not enter the other's totals), writes HTML, the JSON and the plain per-file table under target/coverage/<crate>/, and excludes src/proofs.rs (Kani-only, cfg(kani)) plus test and bench files: it measures the library. `just coverage-check` reads docs/coverage-floor.md and fails when a crate's total line coverage is more than 0.5 pp below its floor; regions and branches are recorded for context but not gated, since branch coverage is the noisier number across compiler versions. First measurement from the full run: ledger-core 90.01% lines (88.86% regions, 82.65% branches), ledger-store 91.71% lines (85.27%, 80.73%). The store measured 91.98% on an earlier run the same day; properties pick random cases, so a few tenths move between runs and the 0.5 pp tolerance absorbs it (the floor records the lower run). The largest holes are findings, not fixes here: ledger-store/reconcilable.rs is 0% (the server and viewer are its readers; the store suite never calls it), and ledger.rs is mostly the document/payroll replay steps the store's replay tests exercise rather than the core's own. It is not a push gate (the instrumented suites are slow: the store alone runs about a hundred minutes of tests once built); the weekly scheduled workflow runs it beside the proofs. The store's tests start and kill helper processes that inherit LLVM_PROFILE_FILE, so a killed child can leave a truncated profraw; the run passes --failure-mode all, which merges the test binaries' profiles and ignores such a file (it holds no test coverage). Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
This commit is contained in:
1 parent
b10804fb07
commit
986c75b31e
6 files changed
+222
-3
No files matched your search
@@ -5,8 +5,9 @@
|
||||
# Workspace toolchain (clippy and rustfmt for `just check`).
|
||||
rust = [
|
||||
{ version = "1.99", components = "clippy,rustfmt", targets = "x86_64-pc-windows-msvc" },
|
||||
# Fuzzing (cargo-fuzz) and Miri need nightly; pinned so runs repeat.
|
||||
{ version = "nightly-2026-10-01", components = "miri,rust-src" },
|
||||
# Fuzzing (cargo-fuzz), Miri and branch coverage need nightly; pinned so
|
||||
# runs repeat. `llvm-tools` is what cargo-llvm-cov reads profiles with.
|
||||
{ version = "nightly-2026-10-01", components = "miri,rust-src,llvm-tools" },
|
||||
]
|
||||
just = "1"
|
||||
# `just deploy` runs the Netlify CLI through npx.
|
||||
@@ -20,6 +21,9 @@ node = "26"
|
||||
# Mutation testing and fuzzing (docs/oracle.md).
|
||||
"cargo:cargo-mutants" = "27.1.0"
|
||||
"cargo:cargo-fuzz" = "0.13.2"
|
||||
# `just coverage`: line and branch coverage of the core and the store
|
||||
# (docs/coverage-floor.md).
|
||||
"cargo:cargo-llvm-cov" = "0.9.1"
|
||||
# A compile cache shared by every jj workspace's target dir: point
|
||||
# cargo's build.rustc-wrapper at it (~/.cargo/config.toml).
|
||||
sccache = "0.18.0"
|
||||
|
||||
Reference in new issue
Block a user