Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1.09 KB

README.md

File metadata and controls

31 lines (24 loc) · 1.09 KB

junit5-parallel-tests

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:

  1. Enable JUnit 5 parallel tests execution but run everything sequentially by default (status quo).
  2. Create custom @ParallelizableTest annotation promoting class-level parallelization (all the tests methods inside will be executed in parallel).
  3. 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.

Requirements

  • Java 17+
  • Maven 3.8

Running tests

In parallel (default)

mvn clean verify

Sequentially

mvn clean verify -DparallelTests=false