diff --git a/.github/workflows/gpu_test.yml b/.github/workflows/gpu_test.yml index 4fdffab057..d3aa03d2f6 100644 --- a/.github/workflows/gpu_test.yml +++ b/.github/workflows/gpu_test.yml @@ -72,4 +72,5 @@ jobs: uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1 with: token: ${{ secrets.CODECOV_TOKEN }} + flags: gpu verbose: true # optional (default = false) diff --git a/.github/workflows/hypothesis.yaml b/.github/workflows/hypothesis.yaml index 1ec6b4806d..a6a5ebbe6a 100644 --- a/.github/workflows/hypothesis.yaml +++ b/.github/workflows/hypothesis.yaml @@ -81,6 +81,7 @@ jobs: uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} + flags: tests verbose: true # optional (default = false) - name: Generate and publish the report diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8c55c7e93d..d0e244f507 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,6 +71,7 @@ jobs: uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} + flags: tests verbose: true # optional (default = false) test-upstream-and-min-deps: @@ -110,6 +111,7 @@ jobs: uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} + flags: tests verbose: true # optional (default = false) doctests: diff --git a/codecov.yml b/codecov.yml index ef535fd8fe..a3783cc39a 100644 --- a/codecov.yml +++ b/codecov.yml @@ -8,9 +8,21 @@ coverage: default: target: auto threshold: 0.1 + flags: + - tests +flags: + tests: + paths: + - src/ + carryforward: true + gpu: + paths: + - src/ + carryforward: true codecov: notify: - after_n_builds: 10 # Wait for all 10 reports before updating the status + # 6 = test.yml: 3 (optional+ubuntu) + 2 (upstream + min_deps), hypothesis: 1 + after_n_builds: 6 wait_for_ci: yes comment: layout: "diff, files" diff --git a/pyproject.toml b/pyproject.toml index 8277c3f752..96932a9611 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -155,10 +155,6 @@ hooks.vcs.version-file = "src/zarr/_version.py" dependency-groups = ["test"] [tool.hatch.envs.test.env-vars] -# Required to test with a pytest plugin; see https://pytest-cov.readthedocs.io/en/latest/plugins.html -COV_CORE_SOURCE = "src" -COV_CORE_CONFIG = ".coveragerc" -COV_CORE_DATAFILE = ".coverage.eager" [[tool.hatch.envs.test.matrix]] python = ["3.12", "3.13", "3.14"] @@ -175,13 +171,23 @@ matrix.deps.dependency-groups = [ ] [tool.hatch.envs.test.scripts] -run-coverage = "pytest --cov-config=pyproject.toml --cov=src --cov-append --cov-report xml --junitxml=junit.xml -o junit_family=legacy" -run-coverage-html = "pytest --cov-config=pyproject.toml --cov=src --cov-append --cov-report html" -run = "run-coverage --no-cov --ignore tests/benchmarks" +run-coverage = [ + "coverage run --source=src -m pytest --junitxml=junit.xml -o junit_family=legacy {args:}", + "coverage xml", +] +run-coverage-html = [ + "coverage run --source=src -m pytest {args:}", + "coverage html", +] +run = "pytest --ignore tests/benchmarks" run-verbose = "run-coverage --verbose" run-mypy = "mypy src" -run-hypothesis = "run-coverage -nauto --run-slow-hypothesis tests/test_properties.py tests/test_store/test_stateful*" +run-hypothesis = [ + "coverage run --source=src -m pytest -nauto --run-slow-hypothesis tests/test_properties.py tests/test_store/test_stateful* {args:}", + "coverage xml", +] run-benchmark = "pytest --benchmark-enable tests/benchmarks" +serve-coverage-html = "python -m http.server -d htmlcov 8000" list-env = "pip list" [tool.hatch.envs.gputest] @@ -195,8 +201,11 @@ features = ["gpu"] python = ["3.12", "3.13"] [tool.hatch.envs.gputest.scripts] -run-coverage = "pytest -m gpu --cov-config=pyproject.toml --cov=src --cov-report xml --junitxml=junit.xml -o junit_family=legacy --ignore tests/benchmarks" -run = "run-coverage --no-cov" +run-coverage = [ + "coverage run --source=src -m pytest -m gpu --junitxml=junit.xml -o junit_family=legacy --ignore tests/benchmarks {args:}", + "coverage xml", +] +run = "pytest -m gpu --ignore tests/benchmarks" [tool.hatch.envs.upstream] template = 'test'