-
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
CompilerGeneratedAttribute
excludes new class
#1437
Comments
CompilerGeneratedAttribute
excludes new class
I create a small reproducible repo here: https://github.com/cheesi/coverlet-issue-1437 I also checked in the two generated coverage results, one with the Command: |
@cheesi Thanks a lot for the repro, as this makes it much easier for us 🙏 . We will take a look asap. |
OK I analyzed this today and this is the correct behaviour if excluded by For instance if you leave the |
Hey @daveMueller ! Thank you very much for your help! So the suggested way is to remove the |
Yes I would advise to remove it. Only thing that I have in mind are auto-implemented properties that after removing could be reported as uncovered (instead of beeing skipped). But therefore there is the @petli @MarcoRossignoli @tonerdo Any other thoughts on this? |
We cannot do a lot for it as @daveMueller explained, I also suggest to remove the attribute and handle the "noise" with other filtering. |
Alright, thanks for your help guys! |
Hello!
We have a strange issue in our project.
We added a new class that basically looks like this:
This new class (&method) does not show up in our code coverage report:
I also already ruled out any display or converting issues (report generator), it is definitely already missing in the opencover file, we get from our build.
However, all other classes from that package are found. The strange thing is, that our other Behaviours classes are really similar. Like same generics, same method definition and so on. The only difference would be our
ITransactionCommand
interface, but also already tried removing that.After some digging I found out, that this class gets excluded with the
CompilerGeneratedAttribute
Our test execution looks like this:
As soon as I remove the
CompilerGeneratedAttribute
from theExcludedByAttribute
list, the new class gets detected.Our environment:
This looks like a bug to me and to be honest, I have zero clue, why it is behaving in that way.
Some differences to our other behaviours:
System.Transactions
using
statement forIDisposable
Handle
method, instead of multiple methods (that are called by theHandle
method)Apparently this was already a problem in the past: #794
If needed, I can try to create a minimal reproducible repo.
The text was updated successfully, but these errors were encountered: