diff --git a/.codecov.yml b/.codecov.yml index 62be777b..8836913f 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,5 +1,7 @@ -# show coverage in CI status, not as a comment. +# show coverage in CI status, not as a comment. comment: off +fixes: + - "*/site-packages/::" coverage: status: project: @@ -7,4 +9,4 @@ coverage: target: auto patch: default: - target: 20% + target: 20% diff --git a/.coveragerc b/.coveragerc index f2a1e5ce..937d6069 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,3 +1,16 @@ [run] # this file comes from versioneer and we don't test it omit = */_version.py + +[paths] +# This tells coverage how to combine results together or said differently +# which files at different paths are actually the same file +# documented at https://coverage.readthedocs.io/en/latest/config.html#paths +# Yes, we list repo2docker twice here. This allows you to install repo2docker +# with `pip install -e.` for local development and from the wheel (as done on +# CI) and get `repo2docker/foo.py` as paths in the coverage report +source = + repo2docker + repo2docker + ../repo2docker + */site-packages/repo2docker diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e6de4dc..5362a497 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -114,7 +114,11 @@ jobs: - name: "Run tests" run: | - pytest --durations 10 --cov repo2docker -v tests/${{ matrix.repo_type }} + cd tests + pytest --durations 10 --cov repo2docker -v ${{ matrix.repo_type }} - # Action Repo: https://github.com/codecov/codecov-action - - uses: codecov/codecov-action@v1 + - name: "Upload code coverage stats" + run: | + pip install codecov + pushd tests && codecov && cat + cat /home/runner/work/repo2docker/repo2docker/tests/coverage.xml