我有一个父套件,其中包括子套件,子套件本身包含不同的测试(相同的测试可能包含在多个子套件中)。如果我启用并发,则只有子套件内的那些测试才会并行运行。子套件本身并不并行运行。但我希望子套件也并行运行(或只是子套件)。
家长套房:
@Suite
@IncludeTags({"DifferentTagsUsedInTests"})
@SelectClasses({ChildSuiteA.class, ChildSuiteB.class})
@ConfigurationParameter(key = "config for all tests", value = "within this suite")
public class ParentSuite {}
儿童套房:
@Suite
@IncludeTags({"DifferentTagsUsedInTests"})
@SelectPackages("my.tests")
@ConfigurationParameter(key = "additional config for all tests", value = "within this suite")
public class ChildSuiteA {}
简短的回答是 JUnit Platform Suite Engine 不支持并行执行。
从概念上讲,JUnit 5 由 JUnit 平台 + 多个测试引擎组成。用于启用并行执行的属性以
junit.jupiter.
为前缀。这说明它只适用于Jupiter Engine,而不适用于Suite Engine。 Suite Engine 没有等效的属性。