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

Metrics in metrics table may be listed in the wrong column when combining coverage reports of different types #371

Closed
egraff opened this issue Aug 6, 2020 · 2 comments
Labels

Comments

@egraff
Copy link

egraff commented Aug 6, 2020

In my setup, I have some test projects that are multi-targeted against both .NET Framework and .NET Core / .NET Standard. When running tests for .NET Framework, I'm using OpenCover for code coverage, wheres for .NET Core and .NET Standard, I'm using coverlet, which generates code coverage reports in the cobertura format.

When feeding both OpenCover and cobertura reports for the same project into ReportGenerator (the parser is listed as MultiReportParser (Nx CoberturaParser, Mx OpenCoverParser), the metrics shown for the cobertura report ends up in the wrong columns, as shown in the image below:

image

I'm guessing because only the OpenCover report has metrics for the "NPath complexity", the sequence coverage and branch coverage of the cobertura results are shifted one column too far to the left. The expected result would be that the rows from the cobertura report either are filled with blank columns for the missing metrics, or the columns were reordered to prevent this.

I.e. it should have looked something like this:

image

For completeness, here is a snippet of the generated HTML (I've removed the title attrs):

<tbody>
<tr><td><a href="#file0_line19" class="navigatetohash">.ctor(...)</a></td><td>2</td><td>2</td><td>100%</td><td>66.67%</td><td>2</td></tr>
<tr><td><a href="#file0_line19" class="navigatetohash">.ctor(...)</a></td><td>2</td><td>100%</td><td>50%</td></tr>
<tr><td><a href="#file0_line28" class="navigatetohash">.ctor()</a></td><td>1</td><td>0</td><td>100%</td><td>100%</td><td>1</td></tr>
<tr><td><a href="#file0_line28" class="navigatetohash">.ctor()</a></td><td>1</td><td>100%</td><td>100%</td></tr>
...
@danielpalme
Copy link
Owner

Thanks for reporting this issue.

I will fix this end of august.

danielpalme added a commit that referenced this issue Aug 27, 2020
@danielpalme
Copy link
Owner

danielpalme commented Aug 29, 2020

Fixed in release 4.6.5:
https://www.nuget.org/packages/ReportGenerator/4.6.5

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