-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Run only "untagged" tests #1679
Comments
We could introduce special tag expressions for "no tags" and "at least one tag", e.g. @junit-team/junit-lambda WDYT? |
I agree that
I had a similar idea: great minds think alike. 😉 How about |
Though in terms of the tag expression parsing, it might be better to avoid the use of parentheses. So perhaps something like We'd just need to make sure we pick special characters that were not previously valid (i.e., perhaps already used by somebody). Disclaimer: I haven't looked at the exact syntax parsing recently. So the above suggestion may potentially be bogus. 😇 |
If I'm not mistaken, How about |
As a note, my current workaround is to use the Launcher#discover method as part of my build, such that all found tags can be excluded. Our specific implementation of this can be found here. |
Yeah... as I hinted at, my proposal could well have been bogus, and it in fact is. In hindsight, we really should have been more restrictive with valid characters in tag names (see
How about As in...
|
I think |
OK. I can agree with you on that, when you phrase it like that. 😉 |
To make it more clear:
|
Still looking for this! It's nice for running tests locally in IntelliJ w/o Gradle. It'd be snappy to pass a tag expression to run untagged tests. |
Tentatively slated for 5.6 M2 solely for the purpose of team discussion. |
Team Decision: Let's go with @calvertdw Would you be interested in submitting a PR? |
Should the special terms play nice with operators or be treated separately?
Or is only this allowed and the previous examples are all invalid input?
Treating the 1st sample block as invalid inputs makes the implementation way easier. |
I would favour simplicity over completeness |
If it considerably simplifies the implementation, I'm fine with only supporting |
In progress |
I think Consider the documentation and support in factoring the complexity. Not supporting expressions might be confusing to users. |
I see @mmerdes has taken this up, but I might be able to assist given some pointers in the right direction. What classes/interfaces are relevant? In general, what's a good way to do it? |
@calvertdw |
#1679 Co-Authored-By: Marc Philipp <[email protected]>
#1679 Co-Authored-By: Marc Philipp <[email protected]>
#1679 Co-Authored-By: Marc Philipp <[email protected]>
Two special expressions, `any()` and `none()`, can now be used in tag expressions to select all tests _with_ any tags at all, or all tests _without_ any tags, respectively. Resolves #1679.
I just wanna say "Thank You" to everyone who worked on this enhancement. My project's Gradle scripts got simplified significantly when I was finally able to make use of the new any() and none() capability of JUnit 5.6. It's very useful! |
I request the ability to run only "untagged" tests.
Most tests will run with default arguments and should not require
@Tag("fast")
. Other tests require special needs or take a long time so we tag them (i.e.@Tag("slow")
). I would prefer not to require the majority of tests to be tagged at all.Current workarounds include parsing the code for all declared instances of
@Tag("*")
or using the Launcher#discover method in the build phase, such that all found tags can be excluded.Deliverables
excludeTags
property to exclude all tests that are tagged OR some solution providing the equivalent result.The text was updated successfully, but these errors were encountered: