-
-
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
MS Coverage output isn't cleaning compiler generated methods/types #663
Comments
Probably Microsoft CodeCoverage uses a slightly different formatting that other tools (e.g. coverlet). |
My assumption is correct. The format is different: dotnet-test coverlet Will have to adjust in ReportGenerator |
I invested several hours, but I have not yet found a way filter out those classes and at the same time don't miss any relevant coverage results. |
@erichiller Do you know if the @danielpalme Maybe I'm missing something, but couldn't you just exclude/merge all types that have an invalid name? The compiler generates those invalid names to make sure they will never clash with the actually written code. |
@cremor |
I meant |
I will have a look again as soon as possible. |
I just made some change to improve the handling of Cobertura files generated by "Microsoft Coverage". In your example the coverage file contains the following class names: RequestState.RequestStateManager<TRequestMessage, TResponseMessage, TChannelOutput> With my change, only the following element will appear in the report: RequestState.RequestStateManager<TRequestMessage, TResponseMessage, TChannelOutput> I will do some more testing and probably publish a new release within the next days. |
I just released version 5.3.6 with some improvements regarding Microsoft CodeCoverage. |
@danielpalme in some cases (async + generics + static) classes are still reported multiple times in 5.3.6
More details in microsoft/codecoverage issue |
I will have a look in the next days. |
@danielpalme for nested classes also getting duplicated statistics in report |
@standsed TLDR: |
Describe the bug
When using Microsoft CodeCoverage (aka
dotnet-coverage
) which can now export in Cobertura format, the Cobertura is not cleaned up for compiler generated types and methods where the names are mangled.A real example, for a single class, the following classes are present in the CodeCoverage output Cobertura file:
Which results in the following classes being reported:
TResponseMessage, TChannelOutput>
sponseMessage, TChannelOutput>
sponseMessage, TChannelOutput>
sponseMessage>
To Reproduce
Any use of Microsoft CodeCoverage on any codebase with constructs such as
async
methods, local functions, etc. causes these same issues.The text was updated successfully, but these errors were encountered: