Seeing "No mutations found" using Gradle plugin

Skip to first unread message

Ben Frey

Oct 11, 2022, 1:39:39 PM10/11/22
to PIT Users
Using gradle-pitest-plugin version 1.9.0 and the below configuration (oh how I miss the old Google Groups with code formatting...), I get

Exception in thread "main" No mutations found. This probably means there is an issue with either the supplied classpath or filters.

I have found a few similar posts on here, but nothing recent and no answers regarding the Gradle plugin. What might be going wrong, and how can I fix it?

pitest configuration:
pitest {
    if (Os.isFamily(Os.FAMILY_WINDOWS)) {
        useClasspathFile = true
    junit5PluginVersion = '1.1.0'
    targetClasses = ['*', '*.SpringBootApplication]
    threads = 4
    timeoutConstInMillis = 60000
    mutationThreshold = 0
    coverageThreshold = 0
    outputFormats = ['XML', 'HTML']
    timestampedReports = false
    enableDefaultIncrementalAnalysis = true
    jvmArgs = ['-Xmx2G']
    avoidCallsTo = ['java.util.logging', 'org.apache.log4j', 'org.slf4j', 'org.apache.commons.logging']
    excludedMethods = ['hashCode']

Marcin Zajączkowski

Oct 14, 2022, 5:26:44 AM10/14/22
to 'Joni' via PIT Users
Ben, start with the minimal configuration (probably junit5PluginVersion
and maybe targetClasses if it varies from your group). If successful,
try to add more properties. If not, do you have multiple modules in your
project? Please provide minimal project which reproduce the problem.

Btw, why useClasspathFile is enabled only for Windows? Is it broken on

Btw2, "['*', '*.SpringBootApplication]" might be broken.
Maybe it is just copy-paste. And SpringBootApplication is not in your
"" package?


-- - Working code is not enough

Ben Frey

Oct 14, 2022, 9:29:53 AM10/14/22
to PIT Users
It turns out I had some zombie Gradle daemons or something. I killed all Java processes and the mutation test task ran fine.

I don't know about why useClasspathFile is only enabled for Windows. This project was written by a sister team who mainly uses Windows machines whereas my team is all Mac. Also not sure about your btw2.
Reply all
Reply to author
0 new messages