-
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
Coverlet is not considering the excludefromCoverage attribute at method level #809
Comments
Thank's for repro, I'll take a look asap. |
@VenkateshSrini can you tell me where is these methods? I searched |
@VenkateshSrini any news? |
In the repository folder, there is a file called TaskRepo.cs. In that, there is a method called EditTask that has [ExcludeFromCodeCovergae] |
No. I just downloaded the attached code bit I'ma able to see the same. Let me upload it once again Please click on the link on this post to download it |
Ok now I can repro, seems a bug, btw you cannot use Thanks for reporting this. |
@MarcoRossignoli , |
Why are you using that attribute filter?What do you want to filter out? |
Glad I found this thread. I was just about to report this bug. ExcludeFromCodeCoverage attribute seems to work for non-async methods but not async in my case. |
Thanks for the informations |
@MarcoRossignoli , |
@VenkateshSrini I understood I meant that you cannot use |
ok. So how should I go about this in the current scenario |
I'm fixing, for the moment you could use partials and put method you don't want cover into it and filter out with exclude by filename https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/MSBuildIntegration.md#source-files. |
Should be fixed, feel free to reopen if needed. |
Is it possible that |
Engine is the same so I expect same behavior |
Hi,
I'm using the Coverlet to measure .NET core 3.1 Web API code coverage. I have used entity framework for creating by repository. There are some methods have anonymous object as return types and hence could not be unit tested. I want those methods to be alone excluded from coverage so I used [ExlcudeFromCodeCoverage] on those methods only. But Coverlet is not considering that at all and still generated the code coverage for the same. Please see the method EditTask in the TaskRepo class as an example in the attached code.
TaskApi.zip
The text was updated successfully, but these errors were encountered: