Path fixing coverage on installed Python packages

Description

I can’t seem to get the path fixing correct for fixing coverage taken of an installed Python package. I use nox to automate testing of my project. I first install my project into the nox virtualenv and then use pytest-cov to test my package. This means that the file paths in my report are wrong. For example, I can see in the report the path /home/runner/work/pyhdltypes/pyhdltypes/.nox/tests/lib/python3.9/site-packages/hdltypes/__init__.py, which should be corrected to src/hdltypes/__init__.py. I figured I could use path fixing here, but I can’t seem to get it right?

My current solution

fixes:
- ".nox/tests/lib/python3.*/site-packages/::src/"

Commit SHAs

d7f8465ea2ab23e7222af9ad4ff10bb61a3661be

Repository

CI/CD or Build URL

Uploader

Using the codecov/codecov-action Github Action

Codecov Output

/home/runner/work/_actions/codecov/codecov-action/v2/dist/codecov -n  -Q github-action-2.0.2 -Z -f .coverage -C d7f8465ea2ab23e7222af9ad4ff10bb61a3661be
[2021-07-31T04:48:21.716Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/

  Codecov report uploader 0.1.0
[2021-07-31T04:48:21.724Z] ['info'] => Project root located at: /home/runner/work/pyhdltypes/pyhdltypes
[2021-07-31T04:48:21.727Z] ['info'] -> No token specified or token is empty
[2021-07-31T04:48:21.809Z] ['info'] Processing .coverage...
[2021-07-31T04:48:21.816Z] ['info'] Detected GitHub Actions as the CI provider.
[2021-07-31T04:48:21.817Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-2.0.2-uploader-0.1.0&token=*******&branch=add-gha&build=1084390934&build_url=https%3A%2F%2Fgithub.com%2Fktbarrett%2Fpyhdltypes%2Factions%2Fruns%2F1084390934&commit=d7f8465ea2ab23e7222af9ad4ff10bb61a3661be&job=Tests&pr=2&service=github-actions&slug=ktbarrett/pyhdltypes&name=&tag=&flags=&parent=
[2021-07-31T04:48:22.318Z] ['info'] Uploading...
[2021-07-31T04:48:22.551Z] ['info'] {"status":"success","resultURL":"https://codecov.io/github/ktbarrett/pyhdltypes/commit/d7f8465ea2ab23e7222af9ad4ff10bb61a3661be"}

Expected Results

Coverage is reported correctly.

Actual Results

“There was an error processing coverage reports.”

The GHA requires coverage data to be in XML first.

1 Like