Repository navigation
ci: report test coverage in the unit test job - #143
Conversation
Add pytest-cov and run the unit tests with --cov, printing per-file coverage with missing lines in the CI log. Coverage settings live in setup.cfg. Closes #142 Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 45 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
LlamaPReview — No blocking issues found
Safe to merge: the unit-test matrix now emits a per-file coverage table via pytest-cov and setup.cfg, and all six Python-version test jobs plus Flake8 pass at this head, so CI outcomes are unchanged as claimed.
1 non-blocking finding retained — highest: Shared test manifest silently drops sanic-testing; six-version unit matrix passes without it.
Review details and evidence
| Priority | File | Finding | Evidence |
|---|---|---|---|
| P2 | test-requirements.txt |
Shared test manifest silently drops sanic-testing; six-version unit matrix passes without it. | confirmed |
Finding details
P2 · Shared test manifest silently drops sanic-testing; six-version unit matrix passes without it.
test-requirements.txt
test-requirements.txt both adds pytest-cov and deletes sanic-testing, while the PR description and commit message mention only coverage reporting. The shared manifest is installed by the flake8 job and every Tests (3.9–3.14) job via pip install -r test-requirements.txt, so the removal silently shrinks the environment used by the whole unit matrix.
Reachable consequence if a test ever needs Sanic's in-process test-client utilities: the unit job would error ("sanic-testing is not installed") or skip rather than run, and coverage would quietly become a weaker lower bound.
Strongest counterevidence: all six version jobs pass at this head with the manifest as changed, and the Sanic smoke job never consumed the shared manifest for this purpose — its own tests/smoketests/sanic/requirements.txt lists Sanic pins, requests, pytest, and -e. only, and both Sanic smoke jobs succeed. sanic itself remains a manifest entry, so only the testing helper disappeared.
This is documentation/traceability of an unrelated delta, not a demonstrated defect: nonblocking.
Owner action: Post-merge acceptable: state the motive (e.g. a sanic>=25.12/Python 3.14 conflict) in the PR body or commit message, or split the removal into its own PR.
Verification boundary: confirmed; scope: bounded reviewed context.
Material unknowns
- Whether a coverage threshold such as
fail_underexists in a config file other thansetup.cfg(e.g.pyproject.toml,pytest.ini,tox.ini,.coveragerc). Cannot change the posture: any such setting would be pre-existing and not introduced by this PR, andsetup.cfgitself contributes none.- Check: No action required; if desired, confirm no coverage threshold is configured outside
setup.cfg.
- Check: No action required; if desired, confirm no coverage threshold is configured outside
- Whether any non-executed test path imports
sanic_testingor callsapp.test_client. Does not decide closure: the six-version unit matrix and both Sanic smoke jobs pass withsanic-testingabsent, so no exercised path depends on it; only silent skips, unsupported by supplied evidence, would escape that reasoning.- Check: No action required; raise only if a future test needs Sanic test-client utilities.
LlamaPReview checks
- Read the complete PR-head file
.github/workflows/code_quality.yml. - Read the complete PR-head file
tests/smoketests/sanic/requirements.txt. - Read the complete PR-head file
setup.cfg.
Still coding alone? Open CarbonChat, a chat room right inside Codex.
Closes #142 (steps 1 and 2).
pytest-covtotest-requirements.txt.pytest --ignore tests/smoketests --cov --cov-report=term-missing.setup.cfggets[coverage:run] source = json_loggingand[coverage:report] show_missing = True.Report only: no threshold, upload or artifact, so CI results do not change. Smoke tests are not measured, so the number is a lower bound.
Tested locally (Python 3.14.6, Windows): the same command prints the per-file table, 95 passed, 80% total on current master. The CI workflow itself has not run yet.