Skip to main content

Module coverage

Module coverage 

Source
Expand description

Coverage rule: the unit suite must clear the configured floor, with test files and the config’s exempt paths out of the denominator. Each language pairs a pure evaluate* over a parsed report with a measure* that shells out to its tool.

Structs§

CoverageReport
A coverage.py JSON report (coverage json), pared to the totals the floor reads and the per-file files block the diff-scoped floor reads.
FileCoverage
One files entry of a coverage.py report — what patch coverage reads to decide whether a changed line is covered.
LlvmCovData
One export entry — --summary-only omits everything but its totals.
LlvmCovMetric
One metric’s totals from an llvm-cov export.
LlvmCovReport
A cargo llvm-cov --json export, pared to the totals the floor reads. A single run produces one data entry.
LlvmCovTotals
The totals block of an llvm-cov export. branches is optional so an export from a run without branch instrumentation still parses.
RustPatchCoverage
Per-file region detail from a cargo llvm-cov --json export — what [crate::patch_coverage::evaluate_patch_rust] restricts to the changed lines.
RustThresholds
The cargo llvm-cov coverage floors, from a [rust].coverage table. lines is always enforced; the rest are opt-in, None skipping the check. A branch floor adds --branch, which instruments only on a nightly toolchain.
Thresholds
The coverage floor to enforce, from a [<language>].coverage table.
Totals
The totals block of a coverage.py report.
TsPatchCoverage
Per-file detail from a vitest Istanbul report — the Istanbul maps reduced to the tuples [crate::patch_coverage::evaluate_patch_typescript] restricts to the diff.
TypeScriptThresholds
The four vitest coverage floors, from a [typescript].coverage table.
VitestMetric
One metric’s totals from a vitest json-summary block.
VitestReport
A vitest coverage-summary.json report, pared to the total block.
VitestTotals
The total block of a vitest json-summary report — the four metrics enforced.

Enums§

Outcome
The result of checking a report against the thresholds.

Functions§

evaluate
Whether report meets thresholds. Branch coverage required but no branches measured is a misconfigured run, and fails.
evaluate_rust
Whether report meets its thresholds. A run that measured no regions at all — a wrong path, or a crate that compiled nothing — fails rather than passing vacuously.
evaluate_typescript
Whether report meets every threshold. A run that measured no code at all fails rather than passing vacuously; one metric with an empty denominator amid a non-empty run has nothing to miss and is vacuously satisfied.
measure
Run the unit suite under coverage.py in root and check it against thresholds. omit is the coverage-rule exemptions as root-relative paths. The coverage CLI, with pytest importable, must be on PATH.
measure_patch_report
Run the Python unit suite with every source under root measured (--source=.), so an untested source shows in files as wholly uncovered rather than vanishing. omit is as in measure.
measure_patch_rust_detail
Run the Rust unit suite under cargo llvm-cov and return the per-file region detail, keyed by the absolute path llvm-cov reports. ignore is the coverage-rule exemptions, dropped so an exempt file’s changed lines are lifted.
measure_patch_typescript_detail
Run the TypeScript unit suite under vitest and return the per-file detail for the four metrics, keyed by the absolute path vitest reports. exclude is the coverage-rule exemptions, dropped so an exempt file’s changed lines are lifted.
measure_report
Like measure_patch_report, but measuring only the files the suite imports, exactly as measure does — the line-scoped exemption path recomputes the floor over that same file set. omit is as in measure.
measure_rust
Run the unit suite under cargo llvm-cov in root and check it against thresholds. ignore is the coverage-rule exemptions as root-relative paths; features the [rust] features list to enable. cargo-llvm-cov must be installed.
measure_typescript
Run the unit suite under vitest coverage in root and check it against thresholds. exclude is the coverage-rule exemptions as root-relative paths; npx resolves the project-local vitest and @vitest/coverage-v8.
parse_llvm_cov_report
Parse a cargo llvm-cov --json export.
parse_report
Parse a coverage.py JSON report (the output of coverage json).
parse_vitest_report
Parse a vitest json-summary report (coverage-summary.json).