Skip to content
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

Simplify --test_filter values for JUnit5 #7061

Closed
joca-bt opened this issue Nov 26, 2024 · 1 comment
Closed

Simplify --test_filter values for JUnit5 #7061

joca-bt opened this issue Nov 26, 2024 · 1 comment
Assignees
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: IntelliJ IntelliJ plugin type: feature request

Comments

@joca-bt
Copy link
Contributor

joca-bt commented Nov 26, 2024

Description of the feature request:

When filtering tests for JUnit5, the plugin is generating filter expressions that look like:

mypackage.myClass#
mypackage.myClass#myMethod$
mypackage.myClass1#(myMethod1|myMethod2)$|mypackage.myClass2#myMethod$

The trailing # and $ were a recent change. While $ may be useful in JUnit3 to determine where a "class boundary" ends, as the plugin is using , for enumeration in that case (i.e. mypackage.myClass1#myMethod1,myMethod2$), it is not needed when the enumeration is between () as in JUnit5.

It should be possible to simplify the filter expressions to something like:

mypackage.myClass
mypackage.myClass#myMethod
mypackage.myClass1#(myMethod1|myMethod2)|mypackage.myClass2#myMethod

While a minor change, this is more closely related with JUnit's selector "language", as these will convert to:

--select-class=mypackage.myClass
--select-method=mypackage.myClass#myMethod
--select-method=mypackage.myClass1#myMethod1 --select-method=mypackage.myClass1#myMethod2 --select-method=mypackage.myClass2#myMethod

and they require less postprocessing in the test runners.

This will also free $ to be used with nested tests. Currently, expressions with nested tests look like:

mypackage.myClass.myNestedClass

which forces test runners to have to determine if a given class is nested or not.

Which category does this issue belong to?

Intellij

What underlying problem are you trying to solve with this feature?

No response

What operating system, Intellij IDE and programming languages are you using? Please provide specific versions.

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@joca-bt
Copy link
Contributor Author

joca-bt commented Nov 26, 2024

@tpasternak regarding #7060, I'd like to discuss the changes proposed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: IntelliJ IntelliJ plugin type: feature request
Projects
Development

No branches or pull requests

3 participants