Skip to content

Commit 655b07e

Browse files
Pin Rust coverage threshold to CI reality (96), drop its auto-ratchet
The Rust coverage check now passes the python3 parser (good), but it exposed a phantom threshold: tarpaulin's line attribution is platform-divergent — macOS reports 67/67=100% while Linux CI reports 66/68=97.1% for the SAME code (lines like 'match name {' and struct-literal fields are attributed differently by the host LLVM; the code is already exercised by existing tests). The 99% threshold had been auto-ratcheted from the inflated macOS number, so CI could never meet it. - coverage-thresholds.json: Rust threshold 99 -> 96 (floor(CI 97.1%)-1, matching the convention used by every other project's threshold). - Makefile _coverage_check: make the Rust block CHECK-ONLY (no auto-ratchet write). Auto-ratcheting platform-divergent coverage captures the highest (macOS) measurement and pins an unmeetable CI threshold. F#/TS ratchets are unchanged (their coverage is platform-stable). Verified: make _coverage_check -> all OK exit 0, and coverage-thresholds.json is NOT mutated by a macOS run (no re-inflation). CI's 97.1% >= 96 passes.
1 parent 4fa5229 commit 655b07e

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

Makefile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,12 @@ _coverage_check:
271271
$(call _cov_check,src/Napper.Core.Tests,$(_FSHARP_COV)/report/Summary.txt,Napper.Core)
272272
$(call _cov_check,src/DotHttp.Tests,$(_DOTHTTP_COV)/report/Summary.txt,DotHttp)
273273
$(call _cov_check,src/Napper.Lsp.Tests,$(_LSP_COV)/report/Summary.txt,Napper.Lsp)
274+
@# Rust is CHECK-ONLY — no auto-ratchet. tarpaulin's line attribution is
275+
@# platform-divergent (macOS reports 67/67=100%; Linux CI reports 66/68=97.1%
276+
@# for the SAME code — lines like `match name {` and struct-literal fields are
277+
@# attributed differently by the host LLVM). Auto-ratcheting would capture the
278+
@# inflated macOS number and set a threshold CI can never meet, so the Rust
279+
@# threshold is pinned manually in coverage-thresholds.json to floor(CI%)-1.
274280
@{ \
275281
t=$$(jq -r '.projects["src/Napper.Zed"].threshold // .default_threshold' coverage-thresholds.json); \
276282
if [ -f "$(_RUST_COV)/report/cobertura.xml" ]; then \
@@ -281,14 +287,7 @@ _coverage_check:
281287
echo " *** FAIL: Rust coverage $${c}% is below threshold $${t}% — ABORTING ***"; \
282288
exit 1; \
283289
fi; \
284-
new_t=$$(( $$(echo "scale=0; $${c}/1" | bc) - 1 )); \
285-
if [ $$(echo "$${new_t} > $${t}" | bc -l) -eq 1 ]; then \
286-
tmp=$$(mktemp); \
287-
jq --argjson nt "$${new_t}" '.projects["src/Napper.Zed"].threshold = $$nt' coverage-thresholds.json > "$${tmp}" && mv "$${tmp}" coverage-thresholds.json; \
288-
echo " RATCHET: Rust threshold -> $${new_t}%"; \
289-
else \
290-
echo " OK"; \
291-
fi; \
290+
echo " OK"; \
292291
else echo " Rust: no data (skipping)"; fi; \
293292
}
294293
@{ \

coverage-thresholds.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"threshold": 98
2020
},
2121
"src/Napper.Zed": {
22-
"threshold": 99
22+
"_note": "Pinned manually (no auto-ratchet): tarpaulin line attribution is platform-divergent — macOS reports 100%, Linux CI reports 97.1% for identical code. Set to floor(CI%)-1.",
23+
"threshold": 96
2324
}
2425
}
2526
}

0 commit comments

Comments
 (0)