-
Notifications
You must be signed in to change notification settings - Fork 153
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
support combining inclusion & exclusion patterns #210
Conversation
A line with the content “!whitelist” can be added to the filter list in order to invert the filters. Only tests matching any of the given filter patterns will be run.
Hi @kpbode, Thanks for the PR. Supporting filtering by inclusion is definitely a feature that is missing (see #177). However it would be better if we could support combining inclusion and exclusion.
For instance user may want to configure like this:
This would execute only tests contained in packages com.searchy.mypackage1 or com.searchy.mypackage2 but excluding the tests ending with IT or SlowTest. RegexFileFilter should be mdified handle to handle those two new special line prefixes when parsing the infinitest.filters file. What do you think? |
Hey @sarod, I just updated my pull request. A filter can now contain "include" and "exclude" entries. Non-prefixed lines will result in exclusions to provide compatibility with legacy files. Best, Karl |
} | ||
|
||
private boolean isValidFilterLine(String line) { | ||
return !Strings.isNullOrEmpty(line) && !line.startsWith("!") && !line.startsWith("#"); |
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.
&& !line.startsWith("!")
is not needed anymore right?
Forget it I didn't realize it was already here
Thanks @kpbode! I did another review. Best, |
@sarod, I integrated your remarks last night. |
Thanks! @kpbode |
A line with the content “!whitelist” can be added to the filter list in order to invert the filters. Only tests matching any of the given filter patterns will be run.