I’d like to be able to execute tests with Gradle based on a category associated with tests.
Example: execute only tests with a Category of ‘CategoryA’
In looking at using JUnit Categories with Gradle, it appears that one would have to put the then entire package reference with Category in the ‘includeCategories’ statement.
We will have tests with the same Category spread across multiple directories.
- org.gradle.login > test 1 annotated with ‘CategoryA’
- org.gradle.square > test 2 annotated with ‘CategoryA’
- org.gradle.circle > test 3 annotated with ‘CategoryA’
- org.gradle.nnnnn > test 4 annotated with ‘CategoryA’
For the example above, would there be a way enter a reference to a parent package (org.gradle), followed by a wildcard pattern, followed by a Category so that it will look for all tests regardless of directory and execute them?
If there is no way to do this with JUnit, are there any other recommendations that may accomplish this?