javajenkinsjava-17mutation-testingpitest

Facing (Kill ratio is NaN% (0 0)) Issue when running Mutation test pittest in Jenkins


Hi we recently migrated from java 11 to java 17 after migration, We are facing following Issue when running MutationTest in Jenkins

Kill ratio is NaN% (0 0) when we run in Jenkins

<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.11.0</version>
<dependencies>
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest-junit5-plugin</artifactId>
<version>1.1.2</version>
</dependency>
</dependencies>
<configuration>
<argLine>
--add-opens java.base/java.lang=ALL-UNNAMED
</argLine> 
</configuration> 
</plugin>

dependency We have used

We Initially Tried with the following version but got same issue

We also Tried with the following version but got same issue

but still we got same issue?

In local in target folder i am able to view html file which reports coverage

In Jenkins we are able to get following

2023-07-17 14:56:31.635  >> Line Coverage: 858/1021 (84%)
2023-07-17 14:56:31.635  >> Generated 280 mutations Killed 203 (73%)
2023-07-17 14:56:31.635  >> Mutations with no coverage 52. Test strength 89%
2023-07-17 14:56:31.635  >> Ran 251 tests (0.9 tests per mutation)
2023-07-17 14:56:31.635  Enhanced functionality available at https://www.arcmutate.com/

but we get Kill ratio is NaN% (0 0) and pit report section no 0,0


Solution

  • Hi All issue was with version of Jenkins plugin installed in our jenkins - if you have admin access to the Jenkins you can verify the plugin version installed

    https://plugins.jenkins.io/pitmutation/releases/

    as you can see the from above link, Those plugin version (latest 1.0-18) is not compatible with latest pitest-maven:1.14.0

    so downgraded to pitest-maven:1.7.3 and junit5 plugin to 0.15 then it started working refer the snip attached

    compatibility

    pom file: enter image description here