You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After running dotnet test with XPlat Code Coverage enabled, the resulting cobertura reports contains classes from auto generated files. I am running the tests on a .NET Maui project.
Specifically, I want to exclude all files ending in .g.cs.
Some examples of offending classes (names blurred):
Currently there is someone working on adding the correct attributes to our source code generators, but for the moment I would like to see if a ExcludeByFile approach is possible. Strangely, the .NET Maui Community Toolkit source code generators get filtered no problem with the above, however our generators (which use Roslyn) does not get properly filtered.
Some questions I have:
Are there known limitations with Roslyn hint-name generated paths that make a simple **/*.g.cs unreliable?
Is there a recommended best-practice to exclude source-generated code purely via ExcludeByFile, or should I rely on attributes?
I feel this should be a simple clear cut problem, however nothing seems to filter these undesirable results.
Feel free to ask for any further clarification if needed, however the information I can give away is limited due to the closed source nature of the code.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
After running dotnet test with XPlat Code Coverage enabled, the resulting cobertura reports contains classes from auto generated files. I am running the tests on a .NET Maui project.
Specifically, I want to exclude all files ending in .g.cs.
Some examples of offending classes (names blurred):
I have attempted to remove these results by adding the following to the .runsettings file:
This does nothing to remove the above results due to our source code generators not including the proper attributes.
Currently there is someone working on adding the correct attributes to our source code generators, but for the moment I would like to see if a ExcludeByFile approach is possible. Strangely, the .NET Maui Community Toolkit source code generators get filtered no problem with the above, however our generators (which use Roslyn) does not get properly filtered.
Some questions I have:
I feel this should be a simple clear cut problem, however nothing seems to filter these undesirable results.
Feel free to ask for any further clarification if needed, however the information I can give away is limited due to the closed source nature of the code.
Beta Was this translation helpful? Give feedback.
All reactions