Repository navigation
ci: report test coverage to GitHub Code Quality - #6
Merged
Merged
Conversation
pytest-cov measures line and branch coverage of src/decdn ([tool.coverage] in pyproject.toml). The test job runs it on every Python version and posts the 3.13 Cobertura report to GitHub Code Quality, best-effort, as decdn's Rust and Solidity coverage jobs do. No fail_under gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
PR coverage is generated from the synthetic merge commit but uploaded against the head commit, potentially producing inaccurate coverage and deltas when main has diverged.
1 open issue
What changed in this PR
Adds coverage reporting for the Python SDK and integrates it with GitHub Code Quality without introducing a coverage threshold.
Changes:
- Configures opt-in line and branch coverage of
src/decdnwith repository-relative paths. - Collects coverage across Python 3.11–3.13 in CI and uploads the 3.13 report on a best-effort basis.
- Documents coverage commands and ignores generated reports.
| File | Description |
|---|---|
uv.lock |
Locks the new coverage dependencies. |
pyproject.toml |
Adds pytest-cov and coverage configuration. |
CONTRIBUTING.md |
Documents coverage usage and corrects the CI version list. |
AGENTS.md |
Adds the coverage command. |
.gitignore |
Excludes coverage data and reports. |
.github/workflows/ci.yml |
Generates coverage reports and uploads to GitHub Code Quality. |
Review effort: Balanced
actions/upload-code-coverage attributes the report to the PR's head commit, while the test matrix checks out the merge commit; when main has moved, the report's lines can belong to different source than the commit receiving it. A separate coverage job checks out the head commit, runs the tests with coverage and uploads, and holds the only code-quality: write permission. The test matrix keeps testing the merge commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Summary
pytest-cov(dev group) and[tool.coverage]inpyproject.toml:uv run pytest --covmeasures line and branch coverage ofsrc/decdn, with repo-relative paths. Plainuv run pyteststays uninstrumented.testjob runspytest --covon 3.11–3.13 and posts the 3.13 Cobertura report to GitHub Code Quality withactions/upload-code-coverage@v1, as decdn's Rust and Solidity coverage jobs do. Best-effort (continue-on-error,fail-on-error: false); the job gainscode-quality: write. Nofail_undergate..gitignorecovers the coverage outputs;AGENTS.mdandCONTRIBUTING.mddocument the command (and the CI table no longer lists Python 3.14).Locally: 471 passed, 96% total (lines 97%, branches 91%).
Test plan
uv lock --check,uv sync --lockeduv run ruff check . && uv run ruff format --check . && uv run mypyuv run pytest --cov --cov-report=xml: report lists onlysrc/decdn/*,coverage.xmlpaths aresrc/decdn/...UV_RESOLUTION=lowest-directrun passesuvx zizmor .githubcleantest (python 3.13)uploads and Code Quality reports on this PR🤖 Generated with Claude Code