-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coverage report run under docker reports incorrect source #329
Comments
Did you try the aliasing options here https://coverage.readthedocs.io/en/v4.5.x/config.html#paths ? |
Yes, in the
Nothing had changed in the report. |
@ionelmc any update? |
So you're generating the report outside the running container? That means you're not using pytest-cov for that. How is that a pytest-cov problem? |
the report is generated inside the container. it is not valid outside the container because the paths are different. |
I'm afraid you need to have the sources in the actual path inside the container, unless I misunderstood how coveragepy works. Either way this ain't a bug in pytest-cov. You could also apply a XSLT the the coverage.xml, in addition to mounting an extra path inside the cotainer. |
@mcaulifn You should open an feature request against coverage.py: when it generates the XML report, it uses the filenames as it knows them. In your case, those are names inside the container. I'm not sure how you would like coverage.py to know what the outside-names are for the files, but we can work that out. |
closing in favor of nedbat/coveragepy#597 |
I am attempting to generate a coverage report for SonarQube. The project is built and tested using a container. The xml file has the source listed
<source>/build/project</source>
where as the actual files are under/data/jenkins/workspace/project/lambda
. Is there a way to re-write the source when generating the report? python and libraries are not available outside the container as this is a Jenkins instance.The text was updated successfully, but these errors were encountered: