pitest-junit5-plugin
pitest-junit5-plugin copied to clipboard
Plugin is not compatible with junit5 junit.jupiter.execution.parallel.enabled true
If your project uses a junit-platform.properties which enable parallel execution, PIT will compute wrong coverage.
As a solution this plugin should disable parallel mode from junit via junit.jupiter.execution.parallel.enabled property.
I suppose in the JUnit5TestPluginFactory createTestFrameworkConfiguration could be a good place to set it (at least it worked for me)
public Configuration createTestFrameworkConfiguration(TestGroupConfig config,
ClassByteArraySource source,
Collection<String> excludedRunners,
Collection<String> includedTestMethods) {
System.setProperty("junit.jupiter.execution.parallel.enabled", "false"); <--- enforce to disable parallel mode
return new JUnit5Configuration(config, includedTestMethods);
}
While #74 already worked-around this specifically for Jupiter engine, #91 provides a generic fix that should work with all test engines and was also tested with Spock. So latest when #91 gets merged, this issue can be closed.