-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
Filter examples based on TestSelector #1216
Conversation
Previously, the Specs2 runner would ignore the selectors that are passed via a `TaskDef`. With this patch, when a `TaskDef`'s selectors contains only `TestSelector`s, then only the examples whose name match the input selectors will be executed.
In case this ends up being accepted, I've already backported this to 4.x: backport-test-selector |
Hi Martin. First of all, thanks for this PR, it looks great with all the tests! However I don't get what is the use for a |
Confession: I just discovered that sbt was proposing to complete the spec names for the |
4757d37
to
b7fd1c3
Compare
Hi Eric, thanks for taking a look. On the command line, I don't know of a way to use the selectors. The selectors are intended to be used programmatically, for instance by an IDE that would trigger the execution of a single test, or an sbt plugin that would retry failed tests. In the examples that you showed, the syntax to execute only a single test case works only for Specs2, whereas the solution based on test selectors is framework-agnostic. My understanding is that this is the reason why, in sbt's test API, Please let me know if this makes the intent behind this pull request clearer. |
Thanks for your explanation @Duhemm. I left another question about the code because I'm not sure about one condition. |
1843073
to
a06f444
Compare
Excellent, thanks @Duhemm. Can you please open a PR for the backport as well? |
Thanks, I just opened #1217. There's no rush in releasing! Sometime before March would be great though 😄 |
Perfect, that will definitely be done by then :-) |
This is published now as |
Previously, the Specs2 runner would ignore the selectors that are passed via a
TaskDef
.With this patch, when a
TaskDef
's selectors contains onlyTestSelector
s, then only the examples whose name match the input selectors will be executed.