-
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
Add [xunit*]*
to default excluded modules filter if not specified
#462
Add [xunit*]*
to default excluded modules filter if not specified
#462
Conversation
[xunit*]*
to default excluded modules filter if not specified[xunit*]*
to default excluded modules filter if not specified
Test with console
|
9d82ca0
to
773a23c
Compare
[xunit*]*
to default excluded modules filter if not specified[xunit*]*
to default excluded modules filter if not specified
@vagisha-nidhi PTAL |
PS. x @tonerdo, all this non-testable code of console/msbuild makes me a bit nervous 😄 we should inject everything #410 (comment), collectors are completely testable, I don't need any manual test. |
LGTM! 👍 |
@@ -57,6 +57,12 @@ static int Main(string[] args) | |||
logger.Level = verbosity.ParsedValue; | |||
} | |||
|
|||
// We add default exclusion filter if no specified | |||
if (excludeFilters.Values.Count == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why did we chose to include if Count == 0
instead of excludeFilters.Values.Contains("[xunit*]*")
?
Since i cannot think an scenario in which we want to include this dlls, and maybe we forgot to include it in our custom exclude
filters. Or we missincluded it using the wrong wildcards or whatever
@MarcoRossignoli
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment says "We add default exclusion filter if no specified" but you are not adding the CoverletConstants. DefaultExcludeFilter
here, but the xunit
one, which i find confusing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since i cannot think an scenario in which we want to include this dlls
The idea is to remove only in default config...after first include users win.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When are you adding the CoverletConstants. DefaultExcludeFilter
btw?
Not sure about the code, but if this later goes into CoverletSettingsParser
then it will never reach the code you added in that file (the if statement), since you add this before reaching that part, and then all it does is add the constants, so count is always 2
If you pass some custom exclude filters as argument, here you don't add xunit, and later count will be >1 , then your if statement is also not excecuted...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CoverletConstants.DefaultExcludeFilter
is needed only by collector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Today we've 3 entry point/driver for coverlet console/msbuild/collector they behave in a different way on defaults.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check manual tests FYI
#462 (comment)
#462 (comment)
@@ -131,6 +131,13 @@ private string[] ParseExcludeFilters(XmlElement configurationElement) | |||
} | |||
} | |||
|
|||
// if we've only one element mean that we only added CoverletConstants.DefaultExcludeFilter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't make that assumption, but more like excludeFilters.Contains(CoverletConstants.DefaultExcludeFilter) && excludeFilters.Count==1
is way safer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CoverletConstants.DefaultExcludeFilter
will be always present
Why not including xunit to the |
If we fix that filter we won't have plan b for possible name collision |
Same for Btw. My pr which i pointed before, magically excluded all dlls that have nothing to do to your code itself without any exclude filters. You might want to take a look to see if it's still applicable. |
Sure @pape77 we can go on with discussion on that PR |
closes #461
cc: @tonerdo @vagisha-nidhi @onovotny