Skip to content

Commit 0e1fde4

Browse files
authored
test: enable codecov in main test action (#2682)
* test: enable codecov in main test action * output coverage report * add codecov.yml * add junit config * comment: false * skip checking TYPE_CHECKING blocks
1 parent 99a3576 commit 0e1fde4

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ jobs:
6060
hatch env run -e test.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }} list-env
6161
- name: Run Tests
6262
run: |
63-
hatch env run --env test.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }} run
63+
hatch env run --env test.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }} run-coverage
64+
- name: Upload coverage
65+
uses: codecov/codecov-action@v5
66+
with:
67+
token: ${{ secrets.CODECOV_TOKEN }}
68+
verbose: true # optional (default = false)
6469

6570
test-upstream-and-min-deps:
6671
name: py=${{ matrix.python-version }}-${{ matrix.dependency-set }}

codecov.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
coverage:
2+
status:
3+
patch:
4+
default:
5+
target: auto
6+
project:
7+
default:
8+
target: auto
9+
threshold: 0.1
10+
comment: false

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ Homepage = "https://github.com/zarr-developers/zarr-python"
103103
[tool.coverage.report]
104104
exclude_lines = [
105105
"pragma: no cover",
106+
"if TYPE_CHECKING:",
106107
"pragma: ${PY_MAJOR_VERSION} no cover",
107108
'.*\.\.\.' # Ignore "..." lines
108109
]
109110

110111
[tool.coverage.run]
111112
omit = [
112-
"src/zarr/meta_v1.py",
113113
"bench/compress_normal.py",
114114
]
115115

@@ -140,8 +140,8 @@ numpy = ["1.25", "2.1"]
140140
features = ["gpu"]
141141

142142
[tool.hatch.envs.test.scripts]
143-
run-coverage = "pytest --cov-config=pyproject.toml --cov=pkg --cov=src"
144-
run-coverage-gpu = "pip install cupy-cuda12x && pytest -m gpu --cov-config=pyproject.toml --cov=pkg --cov=src"
143+
run-coverage = "pytest --cov-config=pyproject.toml --cov=pkg --cov-report xml --cov=src --junitxml=junit.xml -o junit_family=legacy"
144+
run-coverage-gpu = "pip install cupy-cuda12x && pytest -m gpu --cov-config=pyproject.toml --cov=pkg --cov-report xml --cov=src --junitxml=junit.xml -o junit_family=legacy"
145145
run = "run-coverage --no-cov"
146146
run-verbose = "run-coverage --verbose"
147147
run-mypy = "mypy src"
@@ -170,7 +170,7 @@ numpy = ["1.25", "2.1"]
170170
version = ["minimal"]
171171

172172
[tool.hatch.envs.gputest.scripts]
173-
run-coverage = "pytest -m gpu --cov-config=pyproject.toml --cov=pkg --cov=src"
173+
run-coverage = "pytest -m gpu --cov-config=pyproject.toml --cov=pkg --cov-report xml --cov=src --junitxml=junit.xml -o junit_family=legacy"
174174
run = "run-coverage --no-cov"
175175
run-verbose = "run-coverage --verbose"
176176
run-mypy = "mypy src"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy