|
1 | 1 | [[junit-platform-suite-engine]] |
2 | 2 | === JUnit Platform Suite Engine |
3 | 3 |
|
4 | | -The JUnit Platform supports the declarative definition and execution of suites of tests |
5 | | -from _any_ test engine using the JUnit Platform. |
| 4 | +The Suite Engine supports the declarative selection and execution of tests from |
| 5 | +_any_ test engine on the JUnit Platform using the <<launcher-api>>. |
| 6 | + |
| 7 | +image::junit-platform-suite-engine-diagram.svg[role=text-center] |
6 | 8 |
|
7 | 9 | [[junit-platform-suite-engine-setup]] |
8 | 10 | ==== Setup |
@@ -58,3 +60,19 @@ all tests of the test suite. |
58 | 60 | ---- |
59 | 61 | include::{testDir}/example/BeforeAndAfterSuiteDemo.java[tags=user_guide] |
60 | 62 | ---- |
| 63 | + |
| 64 | +[[junit-platform-suite-engine-duplicate-test-execution]] |
| 65 | +==== Duplicate test execution |
| 66 | + |
| 67 | +Depending on the declared test selection, different suites may contain the same tests, |
| 68 | +potentially with different configurations. |
| 69 | +Moreover, tests in a suite are executed in addition to the tests executed by every other |
| 70 | +test engine. This can result in the same tests being executed twice. |
| 71 | + |
| 72 | +image::junit-platform-suite-engine-duplicate-test-execution-diagram.svg[role=text-center] |
| 73 | + |
| 74 | +This can be prevented by configuring your build tool to only include the |
| 75 | +`junit-platform-suite` engine. Or by using a naming pattern. For example, name all suites |
| 76 | +`*Suite` and all tests `*Test` and configure your build tool to only include the former. |
| 77 | + |
| 78 | +Alternatively, consider <<running-tests-tags, using tags>> to select specific groups of tests. |
0 commit comments