Closed SefaOray closed 5 years ago
@SefaOray exclusion attributes don't work on assemblies by design. The --exclude
property is provided for achieving the same.
@tonerdo could you please clarify? I have the same issue here, and ExcludeFromCodeCoverage must work on assemblies https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.excludefromcodecoverageattribute.
exclusion attributes don't work on assemblies by design
@sshukurov by this I mean that Coverlet doesn't check for attributes on assemblies. It does however, have an exclude
option that supports specifying assemblies
@tonerdo it's a pity. I want to define all my exclusions in code, so that different code coverage tools can reuse them.
Agree that ExcludeFromCodeCoverage should work for assemblies unless there is a reason not to.
This should be supported. May this issue be reopened? (And eventually handled... this should not be too complicated to implement.)
This would be useful. I usually execute unit tests and coverage multiple ways: IDE, command line, etc. Declaring this in an assembly attribute would apply to all methods.
@tonerdo I re-opened this issue, I think we should support this behaviour because it's a default for most coverage tools. If you don't agree please let me know. @petli what do you think?
Guys if someone of you can trust the feature we'll be more confident. Will be testable with nightly build tomorrow you can follow this steps https://github.com/tonerdo/coverlet/blob/master/Documentation/ConsumeNightlyBuild.md
@MarcoRossignoli @tonerdo this is exactly what we need :) Is there an ETA for when this fix will be released?
@simonness can you try with nightly to confirm the fix?
Is there an ETA for when this fix will be released?
We don't have a strict release plan at the moment(we're working on it) my idea is one release every quarter(if there are bug we'll release immediatly), so I think for the end of the year, last release 23 Sep https://github.com/tonerdo/coverlet/blob/master/Documentation/ReleasePlan.md#proposed-next-versions
I still see the same issue in VS 2019 with collector v.1.3.0. Can someone help?
@pedramrezaei can you open a new issue?Do you want to skip all assembly?
When you look at the attribute (link below) it specifies it is valid on assemblies, yet it doesn't change the output. Is this an error in documentation?
guys, does it work already? if yes, from which version?
Description When an assembly decorated with ExcludeFromCodeCoverage attribute, it is not excluded from coverage report.
Repro steps Example code:
Expected behavior Assembly is excluded from the coverage report
Actual behavior Assembly is included in the coverage report
Known workarounds Passing the assembly with --exclude "[Assembly]*" works
Related information Cross platform .NET Core code coverage tool version 1.3.0.0 Visual Studio Version: Visual Studio Professional 2017 Microsoft (R) Test Execution Command Line Tool Version 15.9.0 Test project build with .Net Core 2.1