An example project illustrating how to use JUnit 5 parallel tests execution together with Maven Surefire, following the approach described in my article Pragmatic test parallelization with JUnit 5:
- Enable JUnit 5 parallel tests execution but run everything sequentially by default (status quo).
- Create custom
@ParallelizableTest
annotation promoting class-level parallelization (all the tests methods inside will be executed in parallel).- Enable parallel execution for selected tests starting from unit tests (safe default).
For more details about the approach itself (including the motivations behind) just check out the original blog post.
- Java 17+
- Maven 3.8
mvn clean verify
mvn clean verify -DparallelTests=false