Repository navigation
ci: nothing measured how much of the code the tests run - #61
Merged
Merged
Conversation
The OpenSSF Best Practices badge asks for measured statement coverage at silver, and statement and branch coverage at gold, but no workflow measured either. A coverage workflow, adapted from Netweir's, runs the workspace tests on an instrumented nightly build with branch coverage, writes the summary to the job summary, and uploads the text and lcov reports. It fails under the gold thresholds, 90% of lines and 80% of branches, which Parsec is already above: locally, 94.3% of lines, 93.8% of regions, 94.4% of functions and 85.3% of branches. Refs parsec-html#51 Signed-off-by: Foothills Digital <[email protected]>
|
Everyone on this pull request has agreed to the CLA. Thank you. |
jamesconwaydev
approved these changes
Nov 5, 2026
jamesconwaydev
left a comment
Collaborator
There was a problem hiding this comment.
This is good work, thank you. I approved the workflow runs, and the first numbers are already past gold:
| Covered | |
|---|---|
| Lines | 94.31% |
| Regions | 93.78% |
| Functions | 94.36% |
| Branches | 85.30% |
So I'm happy for the thresholds to fail the run from the start, which I'd said to hold off on. With these numbers there's nothing to wait for, and it stops a slide from day one.
The one thing left is the CLA check. Comment the line the bot asked for, and I'll merge once it passes. When it's in, add the numbers to the wiki's Conformance page as you planned, or tell me and I'll add them, credited to you.
Collaborator
Author
|
I have read the CLA and I agree to it. |
1 similar comment
Collaborator
Author
|
I have read the CLA and I agree to it. |
Closed
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.
Problem
The Best Practices badge asks for measured coverage, 80% of statements for silver and 90% of statements plus 80% of branches for gold, and nothing measured it.
Refs #51. The wiki's Conformance page is the other half of that issue; I'll add the numbers there from this workflow's first run on main.
Change
.github/workflows/coverage.yml, adapted from Netweir's, without the Python half:cargo llvm-cov --workspace --branchon nightly, since branch coverage needs it, with the html5lib-tests submodule checked out,coverage.txtandcoverage.lcovas thecoverageartifact,--fail-under-lines 90, and 80% of branches, read from the summary'sTOTALrow since cargo-llvm-cov has no--fail-under-branches.The issue suggested adding the thresholds once Parsec is above them, and it already is (below), so they're in from the start. It runs on pushes to main, on pull requests that change the workflow, and by hand, like Netweir's, so it isn't a required check on every pull request.
Tests
The workflow's commands run locally on nightly (
cargo 1.101.0-nightly, cargo-llvm-cov 0.9.1). All the workspace's tests passed under instrumentation, and the totals were:The lowest are branches in
edit.rs(65.6%),css.rs(74.4%) andserialize.rs(76.1%).The threshold step passes at these numbers.
--fail-under-lines 99exits 1, and the branch check passes on 85.30 and fails on 79.9.actionlintpasses.Checklist
cargo fmt,cargo clippy -- -D warningsandcargo testpass locally (no Rust changed)crates/parsec/src, its tests, examples, scripts or fuzz targets were made in Netweir first (none here)