Generate coverage data using relative paths #135
Labels
area: dev env
Related to the development environment and its setup
area: tests
Related to tests (e.g. unit tests)
priority: 2 - normal
type: feature
New feature or request
Currently, coverage data is generated with absolute paths. This means that if the coverage file is moved across machines, the source code must be in the exact same location. The current workaround is to configure Docker to mount the host's code to the same exact directory within the container. However, this doesn't work for Windows machines since the host's path is not compatible on the Linux container.
The
relative_files = true
setting can be added to.coveragerc
to fix this.Note that coverage seems to rely on the correct file separator being used when generating coverage reports and combining data. In practice, this means that a Windows host will be unable to generate coverage reports since the data coming from the container will have paths with forward slashes. Until this is addressed by coverage.py, the current workaround for Windows users will be to generate coverage reports within the container. This should work for
coverage report
; unsure about other formats such as HTML.The text was updated successfully, but these errors were encountered: