Skip to content

Code coverage threshold#105

Open
gloskull wants to merge 2 commits into
VeriNode-Labs:mainfrom
gloskull:Code-Coverage-Threshold
Open

Code coverage threshold#105
gloskull wants to merge 2 commits into
VeriNode-Labs:mainfrom
gloskull:Code-Coverage-Threshold

Conversation

@gloskull

Copy link
Copy Markdown

Motivation

  • Require a minimum line coverage for PRs to prevent regressions in test coverage across the workspace.
  • Add the tooling and caching needed to produce and check coverage reliably in GitHub Actions.
  • Document the CI coverage gate and the local reproduction steps in the repository README.

Description

  • Add COVERAGE_THRESHOLD: "80" and an Enforce code coverage threshold step to .github/workflows/rust.yml that runs cargo llvm-cov --fail-under-lines "$COVERAGE_THRESHOLD" to fail CI below 80% line coverage.
  • Configure the workflow to install llvm-tools-preview, target wasm32-unknown-unknown, cache cargo outputs with Swatinem/rust-cache@v2, and install cargo-llvm-cov via taiki-e/install-action@cargo-llvm-cov for coverage instrumentation.
  • Update README.md with a new “Continuous Integration” section describing the coverage gate and how to run the equivalent local command using rustup component add llvm-tools-preview and cargo llvm-cov.
  • No source code logic was modified; changes are limited to CI workflow and documentation.

Testing

  • Ran git diff --check and committed the workflow and README changes successfully.
  • Verified cargo build --verbose completed successfully (build OK).
  • Ran the test suite with cargo test --verbose; the run produced 131 passed; 17 failed and overall test result: FAILED, with failures localized to pool_manager tests that panic because Soroban storage is accessed outside of a contract context (needs env.as_contract()), so the coverage gate itself was not the cause of the failures.
  • Ran repository checks including python scripts/storage-layout-check.py (passed) and parsed the workflow YAML with Ruby (passed).

Closes #86

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