Skip to content
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

Bug in conversion from format Cobertura to Html for partial classes #294

Closed
lifemanship opened this issue Nov 5, 2019 · 3 comments
Closed
Labels

Comments

@lifemanship
Copy link

There is issue when we convert Cobertura XML to HTML
When we generate report for partial classes Generator merges all coverage to the first part of partial classes.

@danielpalme
Copy link
Owner

That's the intended behavior.
Coverage is grouped by class and not by file.
Therefore a partial class is handled as a single element and shows all corresponding files.

@lifemanship
Copy link
Author

lifemanship commented Nov 5, 2019

I prepared simple test solution which will show difference between code coverage in html format after conversion from Cobertura and OpenCover formats.
TestCoveragePartialClasses.zip

The Coverage.zip contains:
Coverage.zip

  • UnitTests.xml\Cobertura.UnitTests.TestCoveragePartialClasses.results.xml - coverage created by dotnet with options dotnet test TestCoveragePartialClasses.sln --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura

  • UnitTests.xml\OpenCover.UnitTests.TestCoveragePartialClasses.results.xml - coverage created by dotnet with options dotnet test TestCoveragePartialClasses.sln --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

  • folder cobertura.html - report converted from Cobertura.UnitTests.TestCoveragePartialClasses.results.xml by ReportGenerator.exe with option -reporttypes:Html

  • folder opencover.html -report converted from OpenCover.UnitTests.TestCoveragePartialClasses.results.xml by ReportGenerator.exe with option -reporttypes:Html

As you can see the Html report converted from OpenCover.UnitTests.TestCoveragePartialClasses.results.xml contains valid coverage
image

While the Html report converted from Cobertura.UnitTests.TestCoveragePartialClasses.results.xml contains merged coverage(which is invalid):
image

@danielpalme
Copy link
Owner

Thanks for providing a minimal sample. Now I have understood the problem.

It's already fixed. A new release (4.3.6) should be available within the next 30 minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants