-
-
Notifications
You must be signed in to change notification settings - Fork 283
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
Release 4.8.6 does not produce accurate coverage reports for generic classes anymore #408
Comments
Sorry for that. |
It seems to me that the issue has resurfaced again (report-generator-cli 5.1.3.0), can you please look into it, @danielpalme ? |
@rzikm |
I can reproduce this with the same code as rokeller posted above, but basically:
Although the cobertura report contains section for |
Thanks for the example. Will have a look. |
If you use <class line-rate="1" branch-rate="1" complexity="1" name="DotnetSandbox.GenericClass<T>" filename="Program.cs"> If you use <class name="DotnetSandbox.GenericClass`1" filename="Program.cs" line-rate="1" branch-rate="1" complexity="1"> So with
This won't be easy to fix. I can't just remove
|
I see, thanks for the info about Just an idea, maybe you might be able to differentiate between compiler-generated classes and regular classes by checking where the <> chars occur. My guess is that compiler-generated classes start with '<' (which generics don't) and never end with '>' (which generics do). Since the issue with format differences between |
No need to file a separate issue. Will have a look within the next days. |
@rzikm |
As of the latest release of the global tool (4.8.6), reports generated for generic classes are no longer accurate.
Console output of ReportGenerator:
2021-03-04T10:59:40: Arguments
2021-03-04T10:59:40: -reports:D:\GitSrc1\common\Common.Data\Coverage\Temp*\coverage.cobertura.xml
2021-03-04T10:59:40: -reporttypes:HtmlInline_AzurePipelines_Dark
2021-03-04T10:59:40: -targetdir:D:\GitSrc1\common\Common.Data\Coverage
2021-03-04T10:59:40: -assemblyfilters:-.Tests
2021-03-04T10:59:40: -filefilters:-*.g.cs
2021-03-04T10:59:42: Writing report file 'D:\GitSrc1\common\Common.Data\Coverage\index.html'
2021-03-04T10:59:43: Report generation took 2.9 seconds
It looks like all classes with generic type parameters are affected by this. However, the below minimal class and test easily show the problem too:
While the test does succeed and clearly covers the code, the generated report does report 0 uncovered lines, but also reports 0 covered lines which is clearly wrong.
The text was updated successfully, but these errors were encountered: