-
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
ExcludeFromCodeCoverage
ignored for method in generic class that returns an IAsyncEnumerable
#1431
Comments
@RobARichardson sorry I can't reproduce it. As a repro I have https://github.com/daveMueller/CoverletIssue1431 with coverlet 3.2.0: public class Class1<T>
{
public static async IAsyncEnumerable<int> Demo()
{
yield return 5;
}
} Without the <package name="CoverletIssue1431" line-rate="1" branch-rate="0.5" complexity="4">
<classes>
<class name="CoverletIssue1431.Class1`1/<Demo>d__0" filename="Repos\CoverletIssue1431\CoverletIssue1431\Class1.cs" line-rate="1" branch-rate="0.5" complexity="4">
<methods>
<method name="MoveNext" signature="()" line-rate="1" branch-rate="0.5" complexity="4">
<lines>
<line number="9" hits="1" branch="True" condition-coverage="50% (1/2)">
<conditions>
<condition number="31" type="jump" coverage="50%" />
</conditions>
</line>
<line number="10" hits="1" branch="True" condition-coverage="50% (1/2)">
<conditions>
<condition number="79" type="jump" coverage="50%" />
</conditions>
</line>
<line number="11" hits="1" branch="False" />
</lines>
</method>
</methods>
<lines>
<line number="9" hits="1" branch="True" condition-coverage="50% (1/2)">
<conditions>
<condition number="31" type="jump" coverage="50%" />
</conditions>
</line>
<line number="10" hits="1" branch="True" condition-coverage="50% (1/2)">
<conditions>
<condition number="79" type="jump" coverage="50%" />
</conditions>
</line>
<line number="11" hits="1" branch="False" />
</lines>
</class>
</classes>
</package> After adding the attribute: public class Class1<T>
{
[ExcludeFromCodeCoverage]
public static async IAsyncEnumerable<int> Demo()
{
yield return 5;
}
} I get an empty coverage report which is the expected result. <?xml version="1.0" encoding="utf-8"?>
<coverage line-rate="1" branch-rate="1" version="1.9" timestamp="1673254959" lines-covered="0" lines-valid="0" branches-covered="0" branches-valid="0">
<sources />
<packages>
<package name="CoverletIssue1431" line-rate="1" branch-rate="1" complexity="0">
<classes />
</package>
</packages>
</coverage> @RobARichardson could you provide a repro for us to further investigate the issue? |
This issue is stale because it has been open for 3 months with no activity. |
Originally posted by @RobARichardson in #1383 (comment)
The text was updated successfully, but these errors were encountered: