feat(ci): include e2e tests in coverage measurement#77
Conversation
There was a problem hiding this comment.
Pull request overview
Unifies coverage collection so the cargo-llvm-cov report includes Rust unit/integration/doc tests plus Python (and Bruno) e2e tests as a single merged report, exposed via PR comment, GitHub Step Summary, and Pages artifact.
Changes:
- Add a
--opensovd-coveragepytest option that sets upcargo llvm-covinstrumentation viashow-envinpytest_configureand renders JSON/HTML/Cobertura inpytest_sessionfinish. - Update the CI
coveragejob to drive coverage viauv run pytest, install Node/Bruno/uv, and post or update a sticky PR coverage comment. - Add
scripts/coverage-report.shto render a Markdown coverage summary/detail from the JSON report, and use--locked --all-featuresfor cargo invocations in tests.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/ci.yaml |
Switches coverage to pytest, installs e2e tooling, posts sticky PR coverage comment. |
tests/conftest.py |
Adds --opensovd-coverage, sets up llvm-cov env, writes merged report at session end. |
tests/test_rust.py |
Adds --locked --all-features to cargo test list/doc-test invocations. |
tests/fixtures.py |
Adds --locked to gateway cargo build. |
scripts/coverage-report.sh |
New Markdown renderer for the cargo-llvm-cov JSON report (summary/detail). |
.gitignore |
Ignores generated coverage.json. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Run the whole pytest suite under cargo-llvm-cov: test_rust.py runs the Rust unit/integration/doc and the e2e tests spawn. Publish Cobertura XML and report per-crate/per-file coverage to the run summary.
Coverage: 87.48%3242 of 3706 lines covered (Rust unit tests + e2e).
|
|
@lh-sg We're building something really similar in cicd-workflows repo. and in CDA eclipse-opensovd/classic-diagnostic-adapter#360 @theswiftfox is also working on integrating cargo crap (eclipse-opensovd/classic-diagnostic-adapter#346)
|
The primary goal of this PR is to include e2e tests in code coverage as it increased coverage results significantly. The pr comment was just to verify that it works before I actually merge something. I can use whatever is available. But it seems coverage was just added recently, it was not there when I checked last time.
Sure. As I said. Last time I checked there was no coverage at all.
I dont know crap or it its intention. Need to take a look. Lets talk. |
|
@lh-sag Note: I had to fork it and fix some things related to matching between the scores and the coverage data for bigger projects with a single workspace. I want to create a PR in the upstream repo for that though. |
Will take a look thanks for sharing @theswiftfox . What is your personal verdict about the tool? |
I was positively surprised by the output from the get go. While it has some false positives (like flagging this const fn with a high score, due to the massive match block), most of the time the functions that were scoring high are in fact the things we are aware of needing a refractor. tl/dr: |
The recent CI changes are all agentic, so we could easily fire off a few agents to handle this. |
Summary
Measure coverage across the whole suite (Rust unit/integration/doc + Python e2e) as one merged report.
Local: 213 tests pass, ~87% line coverage.
Checklist