Incomplete file path in XML report
See original GitHub issueOriginally reported by Anonymous
Hi there, we are relying on the XML coverage report generated in coverage.xml
for our analysis.
In previous versions of coverage, when we run the command such as:
$ py.test --cov directory_one --cov directory_two --cov-report xml tests
We would get a coverage.xml
file with sources
listed as:
<sources>
<source>/path/to/directory_one</source>
<source>/path/to/directory_two</source>
</sources>
And each file would be reported in a line such as this:
<class branch-rate="0" complexity="0" filename="directory_one/__init__.py" line-rate="1" name="__init__.py">
Now in coverage 4.4 the first level of the directory path is missing and we get only:
<class branch-rate="0" complexity="0" filename="__init__.py" line-rate="1" name="__init__.py">
Is there any way to get the previous behaviour?
Issue Analytics
- State:
- Created 6 years ago
- Comments:35 (31 by maintainers)
Top Results From Across the Web
Checkstyle generate incompleted XML report - Stack Overflow
I run Checkstyle with Ant. Some projects work correctly, however, there's one project with very strange result. The XML report is not completed, ......
Read more >BI Publisher generates incomplete xml output files for huge data
While running scheduled jobs with xml as output format and SFTP as delivery, BIP is generating and writing the file at specified location....
Read more >Understanding schema errors | HESA
The schema describes the structure of the XML document (number of elements, whether an element can be empty, default/fixed values, etc.) and valid...
Read more >Fixing-Your-XML-Error.pdf - IRS
This Document will assist you with resolving your XML schema validation ... In this example, look at the W2s for the missing or...
Read more >Import XML data - Microsoft Support
The XML file you're trying to open doesn't refer to an XML schema. To work with the XML data that's in the file,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@nedbat I ran across this issue and believe I’ve found a useful workaround.
https://bitbucket.org/suriya/coverage-xml-bug/pull-requests/1/demonstrate-a-fix-to-coverage-xml-bug/diff
Changing from specifying the modules in
[sources]
to directory paths in[include]
ensures that the path to each file is output incoverage.xml
:using [source]:
using [include]:
I’m not sure how this might need to be worded in the project’s documentation, but will try and take a stab at it if you think that’d be useful.
I spent the weekend going crazy with pytest-cov and Codecov.
I can confirm that Codecov walks the
filename=
tags and without a path in them there is not way for it to match the coverage to a file.FYI, the generated
coverage.xml
file says it uses https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd, if that helps any, @blueyed (It’s very bare bones)