Repository navigation
[MINOR][INFRA] Fix Rust coverage badge stuck at 0.0% (wrong llvm-cov JSON key) - #61
Closed
HyukjinKwon wants to merge 1 commit into
Closed
HyukjinKwon wants to merge 1 commit into
HyukjinKwon wants to merge 1 commit into
Conversation
zhengruifeng
approved these changes
Aug 27, 2026
…JSON key) The Rust coverage badge always showed 0.0% (red) while the crate is actually ~90% covered. The parser read data[0]["line_coverage_percent"] from the `cargo llvm-cov --json` output, but that key does not exist: the llvm "export" format puts the summary under data[0]["totals"]["lines"]["percent"] (and regions/functions). The lookup missed, fell back to 0, and published "0.0%". Read totals.lines.percent (falling back to regions then functions). Verified against real `cargo llvm-cov --json` output locally: the parser now yields the actual line-coverage percentage instead of 0. Python coverage was unaffected. Co-authored-by: Isaac <no-reply@databricks.com>
HyukjinKwon
force-pushed
the
fix-coverage-badges
branch
from
August 27, 2026 00:53
bca81e3 to
bc8c341
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Fix the Rust coverage badge, which always showed
0.0%(red) even though thecrate is ~90% covered.
The badge parser read
data[0]["line_coverage_percent"]from thecargo llvm-cov --jsonoutput, but that key does not exist. The llvm "export"format puts the summary under
data[0]["totals"]["lines"]["percent"](andregions/functions). The lookup missed, fell back to0, and published"0.0%". Readtotals.lines.percentinstead (falling back to regions thenfunctions).
Why are the changes needed?
The published Rust coverage badge misreported real coverage as 0%. (The Python
badge was unaffected - it already reads
totals.percent_covered.)Does this PR introduce any user-facing change?
No (CI badge only).
How was this patch tested?
Verified against real
cargo llvm-cov --jsonoutput locally: the parser nowyields the actual line-coverage percentage instead of 0.
This pull request and its description were written by Isaac.