Skip to content

Code coverage threshold#106

Open
gloskull wants to merge 2 commits into
Utility-Protocol:mainfrom
gloskull:Code-Coverage-Threshold
Open

Code coverage threshold#106
gloskull wants to merge 2 commits into
Utility-Protocol:mainfrom
gloskull:Code-Coverage-Threshold

Conversation

@gloskull

Copy link
Copy Markdown
Contributor

Motivation
Prevent regressions by enforcing a workspace line coverage minimum in CI across all Rust contracts and packages.
Provide a reusable, configurable gate that CI and contributors can run locally to verify coverage thresholds.
Description
Add scripts/coverage.sh, a small wrapper that requires cargo-llvm-cov, reads COVERAGE_THRESHOLD (default 80), and runs cargo llvm-cov for the root package and the contracts workspace.
Update .github/workflows/ci.yml to install cargo-llvm-cov and run the coverage gate after cargo test with COVERAGE_THRESHOLD: 80.
Update README.md to document local usage (COVERAGE_THRESHOLD=80 scripts/coverage.sh) and to list the new coverage gate in the CI testing stages.
Testing
Ran bash -n scripts/coverage.sh to validate script syntax and it succeeded.
Ran formatting and unit tests with cargo fmt --all -- --check and cargo test, both of which completed successfully in the environment used for validation.
Verified that local coverage execution was skipped when cargo-llvm-cov was not present locally and that CI will install cargo-llvm-cov before running the gate.
Ran git diff --check to confirm no whitespace or diff errors were introduced.
Closes #85

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code Coverage Threshold Enforcement in CI Pipeline

1 participant