-
-
Notifications
You must be signed in to change notification settings - Fork 441
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
Cobertura coverage-04.dtd support #570
Comments
Looks like v4 adds:
I don't know what "lines-covered" and "branches-covered" mean. "lines-valid", "branches-valid", and "complexity" don't sound like something coverage.py will support. Help me understand what v4 support would mean for you. |
Original comment by Alex Lowe (Bitbucket: amlowe-hcbb, GitHub: Unknown) For me in particular it would mean the ability to use coverage.py with Visual Studio Team Services, of which my company has mandated use and which only supports the v4 files. From what I understand,
|
The XML we produce already includes an attribute that is not in the Cobertura DTD: "missing-branches". Are you sure that VSTS will be ok with this? How is it rejecting the file now? Will it require an actual DTD reference, or just the presence of the attributes it is looking for? |
Original comment by Alex Lowe (Bitbucket: amlowe-hcbb, GitHub: Unknown) VSTS is pretty much a black box about why it cannot read coverage data - all I receive when giving it a coverage file from coverage.py is a warning line stating "No coverage data found. Check the build errors/warnings for more details." However, I modified the coverage.xml generated by coverage.py to add those four required fields to the tag, and it consumed the file without error. So it appears to be that it's only looking for presence of attributes. |
I've added the attributes in b2951020ad92 (bb). If you can, please try this code and let me know how it works. |
This is in 4.4b1. |
Original comment by Alex Lowe (Bitbucket: amlowe-hcbb, GitHub: Unknown) 4.4b1 is working fantastically for me with VSTS. Thank you! For future reference for anyone who comes across this thread while trying to get coverage.py and/or pytest to work with VSTS: The way we built our structure was using the shell script task. pytest is writing a junit-style XML file to ${COMMON_TESTRESULTSDIRECTORY}/test_results.xml and an HTML coverage report to ${COMMON_TESTRESULTSDIRECTORY}/coverage. The XML report is written to ${COMMON_TESTRESULTSDIRECTORY}/coverage.xml. The HTML report is a bit broken inside of Visual Studio (microsoft/azure-pipelines-tasks#3027), but if you want/need it, you can always download it as a Zip file using "Download Code Coverage Results" from the summary page. The XML is the primary source of our coverage data anyway. |
Modified 'coverage' xml node to include: - lines-covered (number of lines where there were no hits) - lines-valid (number of lines of code) - branches-covered (covr does not calculate branching, set to 0) - branches-valid (covr does not calculate branching, set to 0) - complexity (covr does not calculate complexity, set to 0) Further detail: - nedbat/coveragepy#570 - https://github.com/cobertura/web/tree/master/htdocs/xml
* Support for v4 cobertura report Modified 'coverage' xml node to include: - lines-covered (number of lines where there were no hits) - lines-valid (number of lines of code) - branches-covered (covr does not calculate branching, set to 0) - branches-valid (covr does not calculate branching, set to 0) - complexity (covr does not calculate complexity, set to 0) Further detail: - nedbat/coveragepy#570 - https://github.com/cobertura/web/tree/master/htdocs/xml * Update cobertura.R styling editions * Update NEWS.md
Originally reported by Alex Lowe (Bitbucket: amlowe-hcbb, GitHub: Unknown)
I don't know what it would require to be able to support Cobertura's v4 Document Type Definition, but it would be great if coverage.py could support it.
The text was updated successfully, but these errors were encountered: