diff --git a/.codecov.yml b/.codecov.yml index b427851db..430a6e498 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -3,6 +3,7 @@ coverage: project: default: target: auto + threshold: 10% patch: default: target: 80% diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f5c4f0248..0f2b54431 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -21,10 +21,10 @@ jobs: python-version: "3.12" - name: Run unit tests with coverage - run: poetry run pytest -v tests --ignore tests/integration --cov malariagen_data/anoph --cov-report=xml + run: poetry run pytest -v tests --ignore tests/integration --cov malariagen_data --cov-report=xml - name: Upload coverage report - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: files: ./coverage.xml verbose: true diff --git a/tests/anoph/test_snp_data.py b/tests/anoph/test_snp_data.py index bcaf58aa8..d981463e4 100644 --- a/tests/anoph/test_snp_data.py +++ b/tests/anoph/test_snp_data.py @@ -337,7 +337,7 @@ def test_snp_sites_with_virtual_contigs(ag3_sim_api, chrom): check_snp_sites(api, region=region) # Extra checks. - region_size = stop - start + region_size = stop - start + 1 pos = api.snp_sites(region=region, field="POS").compute() assert pos.shape[0] <= region_size assert np.all(pos >= start) @@ -1157,7 +1157,8 @@ def check_snp_allele_counts( assert ac.shape == (pos.shape[0], 4) assert np.all(ac >= 0) an = ac.sum(axis=1) - assert an.max() <= 2 * n_samples + if an.size > 0: + assert an.max() <= 2 * n_samples # Run again to ensure loading from results cache produces the same result. ac2 = api.snp_allele_counts(