I'm using the pitest-maven plugin for my project, and would like to have the maven build fail if there is any mutation that fails.
But I can't see a configuration option that allows me to do that. I can see mutationThreshold and coverageThreshold, but neither of those work.
Ideally, I'd like to use PIT to make sure the tests I've written don't fail any mutations, rather than try to meet a blanket coverage metric.
Is there any way to do that?
Current maven configuration:
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.4.0</version>
<configuration>
<mutationThreshold>100</mutationThreshold>
</configuration>
</plugin>
Recent versions of pitest (I think 1.6.2+) include a test strength threshold, which only considers code that is covered (i.e., you'd need to add an additional coverage limit if the build should fail for uncovered lines).
/**
* Test strength score threshold at which to fail build
*/
@Parameter(defaultValue = "0", property = "testStrengthThreshold")
private int testStrengthThreshold;
Related: