-
Notifications
You must be signed in to change notification settings - Fork 284
Add support to the latest Cobertura format #164
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
Comments
Any idea of if/when this would happen to support TFS usage? |
VSTS only accepts cobertura-04.dtd format. It would be great if we can have it implemented |
That would be great indeed. The only difference between Cobertura's 03.dtd and the new 04.dtd is in the coverage element. Five new required attributes were introduced: lines-covered Does anyone know what information is expected in those attributes? Do we already have that elsewhere or may be at least the summands? Can we get the information from print_xml_report's parameter "covdata"? |
This issue seems to be quite important. The meaning of these attributes can probably be derived from the Cobertura implementation itself. Their XMLReport class looks like a good starting point. Since they use the same code to generate reports for all DTDs, we can do the same. Calculating cyclomatic complexity is clearly out of scope for gcovr, but I think the other parameters can be derived from the CoverageData objects. If someone wants to take a go at this:
Perhaps we also need to add a command line flag so that the DTD version can be selected explicitly. |
For those looking for complexity results, check out https://people.debian.org/~bame/pmccabe/download.html
… On Jan 6, 2018, at 9:29 AM, Lukas Atkinson ***@***.***> wrote:
This issue seems to be quite important.
The meaning of these attributes can probably be derived from the Cobertura implementation itself. Their XMLReport class looks like a good starting point. Since they use the same code to generate reports for all DTDs, we can do the same.
Calculating cyclomatic complexity is clearly out of scope for gcovr, but I think the other parameters can be derived from the CoverageData objects.
If someone wants to take a go at this:
Run the XML tests to verify that gcovr currently works: python gcovr/tests/test_gcovr.py GcovrXml
Add the new required attributes to the report and use the 04.dtd.
Re-run the XML tests. They should now fail due to the added attributes.
For each failing tests, compare the actual report with the reference XML report. If there are no discrepancies other than the new attributes, replace the reference file with the new report.
The tests should now pass again.
Create a pull request to the master branch and mention this issue in the description.
Perhaps we also need to add a command line flag so that the DTD version can be selected explicitly.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I gave it a try and created a pull request for this issue. For the complexity value I have just copied the fixed '0.0' that we also have in the package- and class-elements for example. The tests didn't fail as expected, after my changes, as assertMatchesXmlBaseline() from pyutilib.th doesn't seem to compare doctype nor attributes. |
Thanks to @libPhipp's work in #186, we now use the newer Cobertura format. Everyone: please test the current version with your setup (Jenkins plugins, VSTS, ...) and report any related problems in this thread. To test this new feature, you must install gcovr directly from Github and not from PyPI. For example: $ pip install git+https://github.com/gcovr/gcovr.git |
Today I have tested the new state of the master branch in combination with VSTS and it works like a charm. The coverage statistics are now exported and also the html report can be included: Thanks a lot for your amazing help, @latk ! |
Hi,
Could you add the support of the latest cobertura format coverage-04.dtd for xml output?
Thanks.
The text was updated successfully, but these errors were encountered: