Description
Motivation
Currently, the JUnit Platform provides no safe way to cancel test execution early, e.g. after the first test failed, although this is possible in JUnit 4. The only option is to forcibly terminate the JVM running the tests, but that will also cause cleanup operations, such as deleting temporary files or stopping Docker containers used in tests, to be skipped. Letting all tests run is often wasteful in terms of resources such as CPU and causes longer feedback cycles for developers.
Therefore, we should add a new API to the Platform to allow gracefully stopping test execution early while ensuring resources are cleaned up appropriately. We will also implement cancellation support for the core engines (Jupiter, Suite, Vintage) as well as third-party engines that extend HierarchicalTestEngine
.
Finally, to ensure the new APIs can be consumed from build tools, we should submit issues or PRs to Gradle and Maven Surefire/Failsafe so users can benefit from the new functionality as soon as possible.
Deliverables
- Introduce
LauncherExecutionRequest
#4724 - Introduce support for cancelling a running execution to the Launcher API #1880
- Provide cancellation support for HierarchicalTestEngine implementations #4729 (Jupiter, Spock, Cucumber, ...)
- Provide cancellation support for Suite engine #4730
- Introduce
--fail-fast
mode forexecute
command ofConsoleLauncher
#4732 - Provide cancellation support for Vintage engine #4735
- Provide cancellation support for TestNG engine: Provide cancellation support for JUnit 6.0 testng-engine#232
- Open issue or PR for adoption of cancellation feature in Maven Surefire:
- Open issue or PR for adoption of cancellation feature in Gradle:
Metadata
Metadata
Assignees
Type
Projects
Status