-
Notifications
You must be signed in to change notification settings - Fork 386
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
Generics are not translated correctly #1077
Comments
Which report generator are you using? |
coverage.cobertura.xml <class name="MudBlazor.MudBaseInput`1" filename="Base/MudBaseInput.cs" line-rate="0.9031999999999999" branch-rate="1" complexity="25">
<methods>
<method name="UpdateTextPropertyAsync" signature="(System.Boolean)" line-rate="1" branch-rate="1" complexity="1">
<lines> |
Usually the reports are not intended to be manually read, but as input for reports generator tool like https://danielpalme.github.io/ReportGenerator/ Another sample, opencover report https://github.com/OpenCover/opencover/blob/master/samplexml/opencovertests.xml#L252 |
@MarcoRossignol I use Report generator and the reports show it wrong as well because you have lost the original information. Please see here how to correctly extract the type parameter names for generic types. |
Maybe you would accept a PR for this? |
Oh I see what you mean, I apologize. Need some help from my friend @danielpalme 😄 , Daniel do you have any concern about generics signature update in reports? |
@MarcoRossignoli @danielpalme you will need to encode the angle brackets so they don't break the xml.
edit need to check the cobertura spec |
Changing the XML should work. As @mikes-gh mentioned, brackets have to be encoded. But I would suggest, that I change the behavior in ReportGenerator. That way it would work for all report types, not just for Coberatura files. I could add a mapping that converts class names like this:
|
@danielpalme That would be great thank you.
|
I just made the necessary code changes in ReportGenerator. Next release will contain the change. |
@danielpalme Thank you. 🙏 I presume if @MarcoRossignoli provides the original generic type names in the source with |
This issue is stale because it has been open for 3 months with no activity. |
This issue was closed because it has been inactive for 9 months since being marked as stale. |
It appear generics are not translated correctly in the coverage report. They contain the backtick which would be what it would be if you just did Type.Name
So for example
Converter<T>
will incorrectly translate to Converter`1 in the report.See this for an explanation
https://stackoverflow.com/questions/17480990/get-name-of-generic-class-without-tilde
It would make reading the reports easier
The text was updated successfully, but these errors were encountered: