Seeing "No mutations found" using Gradle plugin

153 views
Skip to first unread message

Ben Frey

unread,
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" org.pitest.help.PitHelpError: 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 = ['com.company.*', '*.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

unread,
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
Linux?

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


Marcin

--
https://blog.solidsoft.pl/ - Working code is not enough

Ben Frey

unread,
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
Forward
0 new messages