is it possible to create a Run/Debug configuration in IntelliJ that picks up only those files that match a regular expression?
I want to run all my unit tests. I do
Short answer:
doesn't work with JUnit 5
Long answer
CrazyCoder kindly responded to my post on Jetbrain's forum. He provided an answer and also uploaded his working project. That was helpful because I verified that pattern matching worked fine on his project.
Then another Jetbrain engineer responded to my How-To request. He pointed out IDEA-164088, JUnit 5 doesn't support pattern configurations
That's a known issue and will be fixed on versions 2017.2.X coming up on April 2017.
Solution
A workaround until then, is to use JUnit5 tags
@Tag("junit")
public class MyTest
and then run the following configuration that only picks up test classes annotated with that particular tag.
P.S. Actually, using Tags seems an even more elegant solution for the given task as long as the number of test classes is limited.