Skip to content

ci: report test coverage to GitHub Code Quality - #6

Merged
thiras merged 2 commits into
mainfrom
ci/coverage
Oct 30, 2026
Merged

thiras merged 2 commits into
mainfrom
ci/coverage

Conversation

@thiras

@thiras thiras commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • pytest-cov (dev group) and [tool.coverage] in pyproject.toml: uv run pytest --cov measures line and branch coverage of src/decdn, with repo-relative paths. Plain uv run pytest stays uninstrumented.
  • CI test job runs pytest --cov on 3.11–3.13 and posts the 3.13 Cobertura report to GitHub Code Quality with actions/upload-code-coverage@v1, as decdn's Rust and Solidity coverage jobs do. Best-effort (continue-on-error, fail-on-error: false); the job gains code-quality: write. No fail_under gate.
  • .gitignore covers the coverage outputs; AGENTS.md and CONTRIBUTING.md document 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 --locked
  • uv run ruff check . && uv run ruff format --check . && uv run mypy
  • uv run pytest --cov --cov-report=xml: report lists only src/decdn/*, coverage.xml paths are src/decdn/...
  • UV_RESOLUTION=lowest-direct run passes
  • uvx zizmor .github clean
  • test (python 3.13) uploads and Code Quality reports on this PR

🤖 Generated with Claude Code

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>
Copilot AI balanced review requested due to automatic review settings October 30, 2026 19:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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/decdn with 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

Comment thread .github/workflows/ci.yml Resolved
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>
@thiras
thiras merged commit 8a6cc18 into main Oct 30, 2026
20 checks passed
@thiras
thiras deleted the ci/coverage branch October 30, 2026 19:29
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.

2 participants