Code coverage threshold#105
Open
gloskull wants to merge 2 commits into
Open
Conversation
…-in-ci-pipeline Enforce CI code coverage threshold (80%)
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.
Motivation
Description
COVERAGE_THRESHOLD: "80"and anEnforce code coverage thresholdstep to.github/workflows/rust.ymlthat runscargo llvm-cov --fail-under-lines "$COVERAGE_THRESHOLD"to fail CI below 80% line coverage.llvm-tools-preview, targetwasm32-unknown-unknown, cache cargo outputs withSwatinem/rust-cache@v2, and installcargo-llvm-covviataiki-e/install-action@cargo-llvm-covfor coverage instrumentation.README.mdwith a new “Continuous Integration” section describing the coverage gate and how to run the equivalent local command usingrustup component add llvm-tools-previewandcargo llvm-cov.Testing
git diff --checkand committed the workflow and README changes successfully.cargo build --verbosecompleted successfully (build OK).cargo test --verbose; the run produced131 passed; 17 failedand overalltest result: FAILED, with failures localized topool_managertests that panic because Soroban storage is accessed outside of a contract context (needsenv.as_contract()), so the coverage gate itself was not the cause of the failures.python scripts/storage-layout-check.py(passed) and parsed the workflow YAML with Ruby (passed).Closes #86