diff --git a/.coveragerc b/.coveragerc index 10530e8c5..21b501e1c 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,10 +1,11 @@ [run] branch = True concurrency = multiprocessing -data_file = .test_reports/.coverage -source = - scilpy/ - scripts/ +data_file = .coverage +source_pkgs = + scilpy + scripts +relative_files = True omit = scripts/tests/*.py scilpy/tests/**/*.py @@ -15,6 +16,11 @@ omit = [report] skip_empty = True +skip_covered = True [html] title = Scilpy Coverage Report +directory = .test_reports/coverage.html + +[xml] +output = .test_reports/coverage.xml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 740cf4692..ded929612 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,16 +56,14 @@ jobs: pytest --cov-report term-missing:skip-covered - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + uses: codecov/codecov-action@v4 with: + token: ${{ secrets.CODECOV_TOKEN }} flags: unittests name: scilpy-unittests-${{ github.run_id }} verbose: true - directory: .test_reports/ fail_ci_if_error: true - root_dir: $GITHUB_WORKSPACE/scilpy/ + plugin: pycoverage - name: Upload test reports and coverage to artifacts uses: actions/upload-artifact@v4.3.1 diff --git a/pytest.ini b/pytest.ini index 5a7cbe175..b4b9224d1 100644 --- a/pytest.ini +++ b/pytest.ini @@ -33,8 +33,7 @@ junit_logging = out-err addopts = --html=.test_reports/pytest.html - --cov-report=html:.test_reports/coverage.html --junit-xml=.test_reports/junit.xml - --cov-report=xml:.test_reports/coverage.xml - --cov=scilpy/ - --cov=scripts/ + --cov + --cov-report html + --cov-report xml