Repository navigation
CI: measure test coverage - #565
Conversation
|
@CodeRabbit review |
Action performed
|
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
MoralCode
left a comment
There was a problem hiding this comment.
Bunch of small things, overall looks good, just installed codecov for this repo
All comments addressed. Also implemented codecov as it was installed for the repo. |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
|
Am a little worried about codecov "display results in all future pull requests" - its probably going to spam the PR with comments if its working in conjunction with coderabbit |
|
The coderabbit is set as manual trigger only. We might be able to do something similar with codecov, or we can see how it goes in the next PRs, if it's too verbose, or concise enough. |
|
Quick look into their docs, and it seems we can do just that. Trigger it manually as well. Probably also set it to a "quiet" mode like in coderabbit. But personally, I'm interested in seeing its capabilities. Seems very interesting from their demo. Being able to generate unit tests on demand by triggering it depending on the PR is quite nice. |
WDYM? you mean generate coverage reports? |
ad57f73 to
52c7926
Compare
that too. But in their docs and website, you're also able to trigger unit tests on demand, and they generate it for the specific PR. So, I think that's quite a nice feature to test as well. |
Adds pytest-cov and a coverage.py configuration that measures line and branch coverage of the collectoss and keyman packages. Coverage is opt-in locally (`uv run pytest --cov`), so a plain pytest run is as fast as before. The "Functional tests" workflow measures it on every pull request, writes the per-file table to the job summary and uploads the XML and HTML reports as an artifact. No minimum coverage is enforced. Database migrations are left out of the measurement. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Caio Fonseca <engcaiofonseca@protonmail.com>
The misspell check reads `cancelled()` as a misspelling. Use `success() || failure()`, which means the same thing: run unless the job was stopped. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Caio Fonseca <engcaiofonseca@protonmail.com>
Signed-off-by: Caio Fonseca <engcaiofonseca@protonmail.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Caio Fonseca <engcaiofonseca@protonmail.com>
599dc79 to
7bc436f
Compare
Description
Adds test coverage measurement, so we can see which parts of the code the tests exercise and which still need tests.
pytest-covto thetestdependency group and a[tool.coverage.*]configuration inpyproject.toml. It measures line and branch coverage of thecollectossandkeymanpackages.uv run pytest --cov. It is not in pytest'saddopts, so a plainuv run pytestis as fast as before.coverage.xmland the HTML report as acoverage-reportartifact.Codecov now installed for the repo, and implemented on this branch.
This PR fixes #564
Notes for Reviewers
Current baseline with the tests on
main(117 tests): 13% combined line and branch coverage.collectoss/apicollectoss/applicationcollectoss/taskscollectoss/utilkeymanChoices worth a second opinion:
contents: readpermission and needs no secrets.Tested locally:
uv run pytest,uv run pytest --covwith the XML, HTML and markdown reports,uv lock --check, and the docs build with-W. The new workflow steps themselves first run on this PR.Signed commits
Generative AI disclosure
If AI tools were used, please provide details below:
- What tools were used? Claude Fable 5.2
- How were these tools used? Design, implementation, local verification
- Did you review these outputs before submitting this PR? Yes.