Fix CI: write coverage database to repo root - #143
Merged
nstarman merged 1 commit intoJul 15, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes CI failures in the OpenAstronomy tox.yml@v1 reusable workflow by ensuring every test matrix job produces a .coverage file in the repository root, which is now required for Codecov upload.
Changes:
- Set
COVERAGE_FILE = {toxinidir}/.coverageintox.iniso coverage data is written to the repo root even whenchangediris used. - Update the CI test matrix to run the
py311-test-alldepsjobs with the-covfactor across linux/windows/macos so those jobs generate coverage output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tox.ini | Forces coverage data file location to the repo root to satisfy CI coverage upload requirements despite changedir. |
| .github/workflows/ci_tests.yml | Adjusts the tox env names so the previously non-coverage py311-test-alldeps jobs run with -cov and generate .coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nstarman
force-pushed
the
claude/fix-ci-failures-b1b3c8
branch
from
July 15, 2026 14:30
fd7bc4b to
ea12a2e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #143 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 14 14
Lines 320 314 -6
=========================================
- Hits 320 314 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CI was failing on the `tests` jobs even though the suite passes. Two
independent problems both broke the OpenAstronomy `tox.yml` coverage upload,
which requires a `.coverage` file in the repo root for every matrix job:
1. The `py311-test-alldeps` jobs (linux/windows) had no `cov` factor, so they
produced no coverage data at all and failed the root `.coverage` check.
Add the `-cov` factor so every matrix job generates coverage.
2. The workflow runs `coverage combine`/`coverage xml` in the repo root via
`uvx coverage`, which installs a bare `coverage` without the `[toml]`
extra. On Python < 3.11 (no stdlib `tomllib`) that build cannot read the
`[tool.coverage.*]` config in `pyproject.toml`, failing the py39/py310 jobs
with:
Can't read 'pyproject.toml' without TOML support. Install with [toml] extra
Move the coverage configuration to a dedicated `.coveragerc` (INI), which
any coverage install can read without TOML support, and point tox's
`--cov-config` at it. coverage discovers `.coveragerc` first and never
attempts to parse `pyproject.toml`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nstarman
force-pushed
the
claude/fix-ci-failures-b1b3c8
branch
from
July 15, 2026 15:36
ea12a2e to
24b1300
Compare
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.
Problem
CI was failing on all
testsmatrix jobs of run 29376673214 even though the test suite itself passed (140 passed). The failure was:The OpenAstronomy
tox.yml@v1reusable workflow now requires a.coveragefile in the root of the workspace for every matrix job in order to upload coverage to Codecov (see the OpenAstronomy tox docs).Root cause
Two things prevented the
.coveragefile from ending up in the repo root:changedirhides the coverage file. The test environments run in a temporary directory (changedir = .tmp/{envname}), so coverage-enabled envs wrote.coveragethere instead of the repo root.py311-test-alldepsjobs (linux/windows/macos) had nocovfactor, so they generated no.coveragefile and failed the new check regardless of thechangedirissue.Fix
COVERAGE_FILE = {toxinidir}/.coveragein[testenv]so the coverage database is always written to the repo root, as recommended by the OpenAstronomy docs.-covfactor to thepy311-test-alldepsmatrix jobs so every matrix job produces a.coveragefile.Verification
140 passed); the only failure was the missing.coveragefile.COVERAGE_FILEto an absolute path makespytest-covwrite.coverageto that path even when pytest runs from a temporarychangedir(and nothing is left behind in the changedir).🤖 Generated with Claude Code