danielpalme / ReportGenerator

ReportGenerator converts coverage reports generated by coverlet, OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov into human readable reports in various formats.
https://reportgenerator.io
Apache License 2.0
2.59k stars 281 forks source link

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

Closed lifemanship closed 4 years ago

lifemanship commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

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 commented 4 years ago

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.