-
Notifications
You must be signed in to change notification settings - Fork 392
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I came across the same issue as #604 and added TestSDKAutoGeneratedCode
to my ExcludeByAttribute
usage (I'm using the MSBuild integration).
However, it looks like coverlet assumes all attributes' type names will end with Attribute
:
coverlet/src/coverlet.core/Instrumentation/Instrumenter.cs
Lines 696 to 697 in f7c3fd4
return excludeAttributeNames.Any(a => | |
customAttribute.AttributeType.Name.Equals(a.EndsWith("Attribute") ? a : $"{a}Attribute")); |
That isn't the case for
TestSDKAutoGeneratedCode
:https://github.com/microsoft/vstest/blob/50b5b33261f7593eb92ae221dae1b9c74234207e/src/Microsoft.TestPlatform.ObjectModel/CodeCoverage/TestSDKAutoGeneratedCode.cs#L10
I believe the fix would be to do something like this, to keep the original functionality:
return excludeAttributeNames.Any(a =>
a.EndsWith("Attribute")
? customAttribute.AttributeType.Name.Equals(a)
: customAttribute.AttributeType.Name.Equals($"{a}Attribute"));
ulrichb
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working