Skip to content

Commit 71fdf82

Browse files
authored
ci: fix coverage (#2115)
1 parent 57c3f3e commit 71fdf82

3 files changed

Lines changed: 11 additions & 8 deletions

File tree

.github/workflows/test-cpu.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ jobs:
4444
matrix:
4545
env: ${{ fromJSON(needs.get-environments.outputs.envs) }}
4646
io_mark: ["zarr_io", "not zarr_io"]
47-
env: # environment variable for use in codecov’s env_vars tagging
47+
env: # environment variables for use in codecov’s env_vars tagging
4848
ENV_NAME: ${{ matrix.env.name }}
49+
IO_MARK: ${{ matrix.io_mark }}
4950
steps:
5051
- uses: actions/checkout@v5
5152
with:
@@ -65,25 +66,27 @@ jobs:
6566
run: uvx hatch -v env create ${{ matrix.env.name }}
6667

6768
- name: Run tests
69+
env:
70+
COVERAGE_PROCESS_START: ${{ github.workspace }}/pyproject.toml
6871
run: |
6972
uvx hatch run ${{ matrix.env.name }}:run-cov -v --color=yes -n auto --junitxml=test-data/test-results.xml -m "${{ matrix.io_mark }}" ${{ matrix.env.args }}
70-
uvx hatch run ${{ matrix.env.name }}:coverage combine
73+
uvx hatch run ${{ matrix.env.name }}:cov-combine
7174
uvx hatch run ${{ matrix.env.name }}:coverage xml
7275
7376
- name: Upload test results
7477
if: ${{ !cancelled() }}
7578
uses: codecov/test-results-action@v1
7679
with:
7780
token: ${{ secrets.CODECOV_TOKEN }}
78-
env_vars: ENV_NAME
81+
env_vars: ENV_NAME,IO_MARK
7982
fail_ci_if_error: true
8083
file: test-data/test-results.xml
8184

8285
- name: Upload coverage data
8386
uses: codecov/codecov-action@v5
8487
with:
8588
token: ${{ secrets.CODECOV_TOKEN }}
86-
env_vars: ENV_NAME
89+
env_vars: ENV_NAME,IO_MARK
8790
fail_ci_if_error: true
8891
files: test-data/coverage.xml
8992

.github/workflows/test-gpu.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ jobs:
7777
run: uv pip list
7878

7979
- name: Run test
80+
env:
81+
COVERAGE_PROCESS_START: ${{ github.workspace }}/pyproject.toml
8082
run: |
8183
uv run coverage run -m pytest -m gpu -n auto
8284
uv run coverage combine

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,15 @@ raw-options.version_scheme = "release-branch-semver"
118118
packages = [ "src/anndata", "src/testing" ]
119119

120120
[tool.coverage.run]
121-
data_file = "test-data/coverage"
121+
data_file = "test-data/raw-coverage"
122122
source_pkgs = [ "anndata" ]
123123
omit = [ "src/anndata/_version.py", "**/test_*.py" ]
124124
concurrency = [ "multiprocessing" ]
125-
parallel = "true"
126-
125+
parallel = true
127126
[tool.coverage.xml]
128127
output = "test-data/coverage.xml"
129128
[tool.coverage.paths]
130129
source = [ "./src", "**/site-packages" ]
131-
132130
[tool.coverage.report]
133131
exclude_also = [
134132
"if TYPE_CHECKING:",

0 commit comments

Comments
 (0)