Coder Social home page Coder Social logo

szpak / gradle-pitest-plugin Goto Github PK

View Code? Open in Web Editor NEW
207.0 11.0 58.0 1.79 MB

Gradle plugin for PIT Mutation Testing

Home Page: http://gradle-pitest-plugin.solidsoft.info/

Groovy 90.64% Java 2.73% Kotlin 0.30% Shell 6.33%
gradle-plugin pit pitest groovy java gradle testing static-analysis code-quality mutation-testing

gradle-pitest-plugin's Introduction

Gradle plugin for PIT Mutation Testing

The plugin provides an ability to perform a mutation testing and calculate a mutation coverage of a Gradle-based projects with PIT.

Maven Central Plugin Portal Build Status Travis Windows Build Status Dependabot Status

Quick start

The simplest way

Add gradle-pitest-plugin to the plugins configuration in your build.gradle file:

plugins {
    id 'java' //or 'java-library' - depending on your needs
    id 'info.solidsoft.pitest' version '1.15.0'
}
with Kotlin DSL
plugins {
    id("java") //or "java-library" - depending on your needs
    id("info.solidsoft.pitest") version "1.15.0"
}

Call Gradle with pitest task:

gradle pitest

After the measurements a report created by PIT will be placed in ${PROJECT_DIR}/build/reports/pitest directory.

Optionally make it depend on build:

build.dependsOn 'pitest'
with Kotlin DSL
tasks.build {
    dependsOn("pitest")
}

Note that when making pitest depend on another task, it must be referred to by name. Otherwise, Gradle will resolve pitest to the configuration and not the task.

Generic approach

"The plugins way" has some limitations. As the primary repository for the plugin is the Central Repository (aka Maven Central) it is also possible to add the plugin to your project using "the generic way":

buildscript {
    repositories {
        mavenCentral()
        //Needed only for SNAPSHOT versions
        //maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
    }
    dependencies {
        classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.15.0'
    }
}
with Kotlin DSL
buildscript {
    repositories {
        mavenCentral()
        //Needed only for SNAPSHOT versions
        //maven {
        //    url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
        //}
    }
    dependencies {
        classpath("info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.15.0")
    }
}

Apply the plugin:

apply plugin: 'java' //or 'java-library' - depending on your needs
apply plugin: 'info.solidsoft.pitest'
with Kotlin DSL
apply(plugin = "java") //or "java-library" - depending on your needs
apply(plugin = "info.solidsoft.pitest")

Plugin configuration

The Pitest plugin does not need to be additionally configured if you use JUnit 4. Customization is done in the pitest block:

pitest {
    targetClasses = ['our.base.package.*']  //by default "${project.group}.*"
    pitestVersion = '1.15.0' //not needed when a default PIT version should be used
    threads = 4
    outputFormats = ['XML', 'HTML']
    timestampedReports = false
}
with Kotlin DSL

Idiomatic and more portable configuration:

pitest {
    targetClasses.set(setOf("our.base.package.*")) //by default "${project.group}.*"
    pitestVersion.set("1.15.0") //not needed when a default PIT version should be used
    threads.set(4)
    outputFormats.set(setOf("XML", "HTML"))
    timestampedReports.set(false)
}

Starting from Gradle 8.1 simple property assignment can be used for configuring plugin (instead of the set() method):

pitest {
    targetClasses = setOf("our.base.package.*") //by default "${project.group}.*"
    pitestVersion = "1.15.0" //not needed when a default PIT version should be used
    threads = 4
    outputFormats = setOf("XML", "HTML")
    timestampedReports = false
}

The configuration in Gradle is the real Groovy code which makes all assignments very intuitive. All values expected by PIT should be passed as a corresponding types. There is only one important difference. For the parameters where PIT expects a coma separated list of strings in a Gradle configuration a list of strings should be used (see outputFormats in the example above).

Check PIT documentation for a list of all available command line parameters. The expected parameter format in a plugin configuration can be taken from PitestPluginExtension.

To make life easier taskClasspath, mutableCodePaths, sourceDirs, reportDir, verbosity and pitestVersion are automatically set by the plugin. In addition sourceDirs, reportDir, verbosity and pitestVersion can be overridden by a user.

There are a few parameters specific for Gradle plugin:

  • testSourceSets - defines test source sets which should be used by PIT (by default sourceSets.test, but allows to add integration tests located in a different source set)
  • mainSourceSets - defines main source sets which should be used by PIT (by default sourceSets.main)
  • mainProcessJvmArgs - JVM arguments to be used when launching the main PIT process; make a note that PIT itself launches another Java processes for mutation testing execution and usually jvmArgs should be used to for example increase maximum memory size (see #7);
  • additionalMutableCodePaths - additional classes to mutate (useful for integration tests with production code in a different module - see #25)
  • useClasspathFile - enables passing additional classpath as a file content (useful for Windows users with lots of classpath elements, disabled by default)
  • fileExtensionsToFilter - provides ability to filter additional file extensions from PIT classpath (see #53)

For example:

pitest {
    ...
    testSourceSets = [sourceSets.test, sourceSets.integrationTest]
    mainSourceSets = [sourceSets.main, sourceSets.additionalMain]
    jvmArgs = ['-Xmx1024m']
    useClasspathFile = true     //useful with bigger projects on Windows
    fileExtensionsToFilter.addAll('xml', 'orbit')
}
with Kotlin DSL
pitest {
    ...
    testSourceSets.set(listOf(sourceSets.test.get(), sourceSets.getByName("integrationTest")))
    mainSourceSets.set(listOf(sourceSets.main.get(), sourceSets.getByName("additionalMain")))
    jvmArgs.set(listOf("-Xmx1024m"))
    useClasspathFile.set(true) //useful with bigger projects on Windows
    fileExtensionsToFilter.addAll("xml", "orbit")
}

Test system properties

PIT executes tests in a JVM independent of the JVM used by Gradle to execute tests. If your tests require some system properties, you have to pass them to PIT as the plugin won't do it for you:

test {
    systemProperty 'spring.test.constructor.autowire.mode', 'all'
}

pitest {
    jvmArgs = ['-Dspring.test.constructor.autowire.mode=all']
}
with Kotlin DSL
tasks.test {
    systemProperty("spring.test.constructor.autowire.mode", "all")
}

pitest {
    jvmArgs.set(listOf("-Dspring.test.constructor.autowire.mode=all"))
}

Eliminate warning in IDEA (Groovy-only)

As reported in #170 IntelliJ IDEA displays warnings about setting final fields (of lazy configuration) in build.gradle. It is not a real problem as Gradle internally intercepts those calls and use a setter instead. Nevertheless, people which prefer to have no (less) warnings at the cost of less readable code can use setters instead, e.g:

    testSourceSets.set([sourceSets.test, sourceSets.integrationTest])
    mainSourceSets.set([sourceSets.main, sourceSets.additionalMain])
    jvmArgs.set(['-Xmx1024m'])
    useClasspathFile.set(true)     //useful with bigger projects on Windows
    fileExtensionsToFilter.addAll('xml', 'orbit')

Multi-module projects support

gradle-pitest-plugin can be used in multi-module projects. The gradle-pitest-plugin dependency should be added to the buildscript configuration in the root project while the plugin has to be applied in all subprojects which should be processed with PIT. A sample snippet from build.gradle located for the root project:

//in root project configuration
plugins {
    id 'info.solidsoft.pitest' version '1.15.0' apply false
}

subprojects {
    apply plugin: 'java'
    apply plugin: 'info.solidsoft.pitest'

    pitest {
        threads = 4

        if (project.name in ['module-without-any-test']) {
            failWhenNoMutations = false
        }
    }
}
with Kotlin DSL
//in root project configuration
plugins {
    id("info.solidsoft.pitest") version "1.15.0"
}

subprojects {
    apply(plugin = "java")
    apply(plugin = "info.solidsoft.pitest")

    pitest {
        threads.set(4)

        if (project.name in setOf("module-without-any-test")) {
            failWhenNoMutations.set(false)
        }
    }
}

It is possible to aggregate pitest report for multi-module project using plugin info.solidsoft.pitest.aggregator and task pitestReportAggregate. Root project must be properly configured to use pitestReportAggregate :

//in root project configuration
plugins {
    id 'info.solidsoft.pitest' version '1.15.0' apply false
}

apply plugin: 'info.solidsoft.pitest.aggregator' // to 'pitestReportAggregate' appear

subprojects {
    apply plugin: 'java'
    apply plugin: 'info.solidsoft.pitest'

    pitest {
        // export mutations.xml and line coverage for aggregation
        outputFormats = ["XML"]
        exportLineCoverage = true
        timestampedReports = false
        ...
        reportAggregator {  //since 1.9.11 - extra results validation, if needed
            testStrengthThreshold.set(50)   //simpler Groovy syntax (testStrengthThreshold = 50) does not seem to be supported for nested properties
            mutationThreshold.set(40)
            maxSurviving.set(3)
        }
    }
}
with Kotlin DSL
//in root project configuration
plugins {
    id("info.solidsoft.pitest") version "1.15.0"
}
apply(plugin = "info.solidsoft.pitest.aggregator")

subprojects {
    apply(plugin = "java")
    apply(plugin = "info.solidsoft.pitest")

    pitest {
        outputFormats.set(setOf("XML"))
        timestampedReports.set(false)
        exportLineCoverage.set(true)
        ...
        reportAggregator {
            testStrengthThreshold.set(50)
            mutationThreshold.set(40)
            maxSurviving.set(3)
        }
    }
}

After the pitest pitestReportAggregate tasks execution, the aggregated report will be placed in the ${PROJECT_DIR}/build/reports/pitest directory.

Integration tests in separate subproject

It is possible to mutate code located in different subproject. Gradle internally does not rely on output directory from other subproject, but builds JAR and uses classes from it. For PIT those are two different sets of class files, so to make it work it is required to define both mainSourceSets and additionalMutableCodePaths. For example:

configure(project(':itest')) {
    apply plugin: 'info.solidsoft.pitest'
    dependencies {
        implementation project(':shared')
    }

    configurations { mutableCodeBase { transitive false } }
    dependencies { mutableCodeBase project(':shared') }
    pitest {
        mainSourceSets = [project.sourceSets.main, project(':shared').sourceSets.main]
        additionalMutableCodePaths = [configurations.mutableCodeBase.singleFile]
    }
}
with Kotlin DSL
configure(listOf(project(":itest"))) {
    apply(plugin = "info.solidsoft.pitest")
    dependencies {
        implementation(project(":shared"))
    }

    val mutableCodeBase by configurations.creating { isTransitive = false }
    dependencies { mutableCodeBase(project(":shared")) }
    pitest {
        mainSourceSets.set(listOf(project.sourceSets.main.get(), project(":shared").sourceSets.main.get()))
        additionalMutableCodePaths.set(listOf(mutableCodeBase.singleFile))
    }
}

The above is the way recommended by the Gradle team, but in specific cases the simpler solution should also work:

configure(project(':itest')) {
    apply plugin: 'info.solidsoft.pitest'
    dependencies {
        implementation project(':shared')
    }

    pitest {
        mainSourceSets = [project.sourceSets.main, project(':shared').sourceSets.main]
        additionalMutableCodePaths = project(':shared').jar.outputs.files.getFiles()
    }
}
with Kotlin DSL
configure(listOf(project(":itest"))) {
    apply(plugin = "info.solidsoft.pitest")
    dependencies {
        implementation(project(":shared"))
    }

    pitest {
        mainSourceSets.set(listOf(project.sourceSets.main.get(), project(":shared").sourceSets.main.get()))
        additionalMutableCodePaths.set(project(":shared").task("jar").outputs.files)
    }
}

Minimal working multi-project build is available in functional tests suite.

PIT test-plugins support

Test plugins are used to support different test frameworks than JUnit4.

JUnit 5 plugin for PIT support (gradle-pitest-plugin 1.4.7+)

Starting with this release the configuration required to use PIT with JUnit 5 has been simplified to the following:

plugins {
    id 'java'
    id 'info.solidsoft.pitest' version '1.15.0'
}

pitest {
    //adds dependency to org.pitest:pitest-junit5-plugin and sets "testPlugin" to "junit5"
    junit5PluginVersion = '1.0.0'    //or 0.15 for PIT <1.9.0
    // ...
}
with Kotlin DSL
plugins {
    id("java")
    id("info.solidsoft.pitest") version "1.15.0"
}

pitest {
    // adds dependency to org.pitest:pitest-junit5-plugin and sets "testPlugin" to "junit5"
    junit5PluginVersion.set("1.0.0")
}

Please note. PIT 1.9.0 requires pitest-junit5-plugin 1.0.0+. JUnit Jupiter 5.8 (JUnit Platform 1.8) requires pitest-junit5-plugin 0.15+, while 5.7 (1.7) requires 0.14. Set right plugin version for JUnit 5 version used in your project to avoid runtime errors (such as `NoSuchMethodError: 'java.util.Optional org.junit.platform.commons.util.AnnotationUtils.findAnnotation(java.lang.Class, java.lang.Class, boolean)')).

The minimal working example for JUnit 5 is available in the functional tests suite.

For mixing JUnit 5 with other PIT plugins, you can read this section in my blog post.

Generic plugin support (also JUnit 5 in gradle-pitest-plugin <1.4.7)

To enable PIT plugins, it is enough to add it to the pitest configuration in the buildscript closure. For example:

plugins {
    id 'java'
    id 'info.solidsoft.pitest' version '1.15.0'
}

repositories {
    mavenCentral()
}

dependencies {
    pitest 'org.example.pit.plugins:pitest-custom-plugin:0.42'
}
with Kotlin DSL
plugins {
    id("java")
    id("info.solidsoft.pitest") version "1.15.0"
}

repositories {
    mavenCentral()
}

dependencies {
    pitest("org.example.pit.plugins:pitest-custom-plugin:0.42")
}

The minimal working example is available in the functional tests suite.

Please note. In gradle-pitest-plugin <1.5.0 the pitest configuration had to be created in the buildscript scope for the root project. Please note. Starting with PIT 1.6.7 it is no longer needed to set testPlugin configuration parameter. It is also deprecated in the Gradle plugin.

Versions

Every gradle-pitest-plugin version by default uses a predefined PIT version. Usually this the latest released version of PIT available at the time of releasing a plugin version. It can be overridden by using pitestVersion parameter in a pitest configuration closure.

Please be aware that in some cases there could be some issues when using non default PIT versions.

If not stated otherwise, gradle-pitest-plugin 1.9.x by default uses PIT 1.9.x, 1.7.x uses PIT 1.7.x, etc. The minimal supported PIT version is 1.7.1.

Starting with version 1.7.0 gradle-pitest-plugin requires Gradle 6.4. The latest version with the Gradle 5.x (5.6+) support is 1.6.0. The current version was automatically smoke tested with Gradle 6.4, 6.9.1 and 7.4.2 under Java 11. Tests with Java 11+ are limited to the compatible versions of Gradle and PIT.

The experimental support for Java 17 can be tested with 1.7.0+.

Starting with the version 1.3.0 the produced binaries require Java 8 (as a JDK used for running a Gradle build). However, having Java 17 LTS released in September 2021, starting with gradle-pitest-plugin 1.9.0, support for JDK <11 is deprecated (see #299).

See the changelog file for more detailed list of changes in the plugin itself.

FAQ

How can I override plugin configuration from command line/system properties?

Gradle does not provide a built-in way to override plugin configuration via command line, but gradle-override-plugin can be used to do that.

After applied gradle-override-plugin in your project it is possible to do following:

./gradlew pitest -Doverride.pitest.reportDir=build/pitReport -Doverride.pitest.threads=8

Note. The mechanism should work fine for String and numeric properties, but there are limitations with support of Lists/Sets/Maps and Boolean values.

For more information see project web page.

How can I change PIT version from default to just released the newest one?

gradle-pitest-plugin by default uses a corresponding PIT version (with the same number). The plugin is released only if there are internal changes or there is a need to adjust to changes in newer PIT version. There is a dedicated mechanism to allow to use the latest PIT version (e.g, a bugfix release) or to downgrade PIT in case of detected issues. To override a default version it is enough to set pitestVersion property in the pitest configuration closure.

pitest {
    pitestVersion = '2.8.1-the.greatest.one'
}
with Kotlin DSL
pitest {
    pitestVersion.set("2.8.1-the.greatest.one")
}

In case of errors detected when the latest available version of the plugin is used with newer PIT version please raise an issue.

How to disable placing PIT reports in time-based subfolders?

Placing PIT reports directly in ${PROJECT_DIR}/build/reports/pitest can be enabled with timestampedReports configuration property:

pitest {
    timestampedReports = false
}
with Kotlin DSL
pitest {
    timestampedReports.set(false)
}

How can I debug a gradle-pitest-plugin execution or a PIT process execution itself in a Gradle build?

Occasionally, it may be useful to debug a gradle-pitest-plugin execution or a PIT execution itself (e.g. NPE in PIT) to provide sensible error report.

The gradle-pitest-plugin execution can be remotely debugged with adding -Dorg.gradle.debug=true to the command line.

However, as PIT is started as a separate process to debug its execution the following arguments need to be added to the plugin configuration:

pitest {
    mainProcessJvmArgs = ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005']
}
with Kotlin DSL
pitest {
    mainProcessJvmArgs.set(listOf("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"))
}

Can I use gradle-pitest-plugin with my Android application?

Short answer is: not directly. Due to some incompatibilities between "standard" Java applications and Android Java applications in Gradle the plugin does not support the later. Luckily, there is an Android fork of the plugin maintained by Karol Wrรณtniak which provides a modified version supporting Android applications (but on the other hand it doesn't work with standard Java applications).

I have JUnit 5 plugin and the execution fails after migration to 1.5.0+, why?

gradle-pitest plugin 1.5.0 finally relaxed the way how (where) the pitest configuration has been placed (#62) which also was generating deprecation warnings in Gradle 6+. This change is not backward compatible and as a result manual migration has to be made - see the release notes. This affects only project with external custom plugins.

Important. As the JUnit 5 plugin for PIT is definitely the most popular, starting with 1.4.7 there is a simplified way how it could be configured with junit5PluginVersion (which is definitely recommended). See my blog post to find out how to migrate (it also solves the compatibility issue with 1.5.0+).

Known issues

  • too verbose output from PIT (also see verbosity option introduced with PIT 1.7.1)

Development

gradle-pitest-plugin cloned from the repository can be built using Gradle command:

./gradlew build

The easiest way to make a JAR with local changes visible in another project is to install it into the local Maven repository:

./gradlew install

There are also basic functional tests written using nebula-test which can be run with:

./gradlew funcTest

Support

gradle-pitest-plugin has been written by Marcin Zajฤ…czkowski with a help from contributors. The author can be contacted directly via email: mszpak ATT wp DOTT pl. There is also Marcin's blog available: Solid Soft - Working code is not enough.

The plugin surely has some bugs and missing features. They can be reported using an issue tracker. However, it is often a better idea to send a questions to the PIT mailing list first.

The plugin is licensed under the terms of the Apache License, Version 2.0.

Stat Counter stats

gradle-pitest-plugin's People

Contributors

3flex avatar bondolo avatar c-otto avatar christophsturm avatar davidburstrom avatar denisverkhoturov avatar dependabot-preview[bot] avatar dependabot[bot] avatar fdaines avatar gvsmirnov avatar koral-- avatar mfvanek avatar mhoennig avatar mikesafonov avatar mleegwt avatar npathai avatar omalleyian avatar pfoerd avatar pkubowicz avatar riggs333 avatar sidb3 avatar szpak avatar szpak-ci avatar thejohnfreeman avatar tomasbjerre avatar vampire avatar xisyn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gradle-pitest-plugin's Issues

classPathFile should not use exposed in configuration

The Gradle plugin itself doesn't provide a direct way to specify a classpath passed to PIT - it is based on the project configuration. Due to an oversight classPathFile has been exposed directly in the plugin configuration. It should be enough to have a useClassPathFile boolean configuration switch to pass a classpath to PIT using an automatically generated file instead of a classpath command line parameter.

Allow to use gradle-pitest-plugin together with robolectric-gradle-plugin

As reported by Jonathas Santos there is a problem when gradle-pitest-plugin is applied in a project with robolectric-gradle-plugin:

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'info.solidsoft.pitest']
   > Failed to apply plugin [id 'java']
      > Cannot add task ':app:test' as a task with that name already exists.

Looking at the robolectric-gradle-plugin source code I see that it uses JavaBasePlugin while gradle-pitest-plugin uses JavaPlugin. They are not compatible (cannot be used together) and for gradle-pitest-plugin JavaBasePlugin is not enough.

Disabling generation of date subfolder

On every mutation run you need to "search" for the latest folder or write an regex parser to move the content of the latest folder into a general public folder.

Is there some way to circumvent this behaviour easier?

Successful build even though mutations survived?

Blundell@MBP:~/repo$ ./gradlew pitest
:core:compileJava UP-TO-DATE
:core:processResources UP-TO-DATE
:core:classes UP-TO-DATE
:core:compileTestJava
:core:processTestResources UP-TO-DATE
:core:testClasses
:core:pitest
4:02:47 PM PIT >> INFO : Verbose logging is disabled. If you encounter an problem please enable it before reporting an issue.
4:02:47 PM PIT >> INFO : Sending 77 test classes to slave
4:02:47 PM PIT >> INFO : Sent tests to slave
4:02:48 PM PIT >> INFO : SLAVE : 4:02:48 PM PIT >> INFO : Found  238 tests
4:02:48 PM PIT >> INFO : Dependency analysis reduced number of potential tests by 0
4:02:48 PM PIT >> INFO : 238 tests received

4:02:52 PM PIT >> INFO : Calculated coverage in 4 seconds.
4:02:52 PM PIT >> INFO : Created  129 mutation test units
4:04:13 PM PIT >> INFO : Completed in 86 seconds
/================================================================================
- Timings
================================================================================
> scan classpath : < 1 second
> coverage and dependency analysis : 4 seconds
> build mutation tests : < 1 second
> run mutation analysis : 1 minutes and 21 seconds
--------------------------------------------------------------------------------
> Total  : 1 minutes and 26 seconds
--------------------------------------------------------------------------------
================================================================================
- Statistics
================================================================================
>> Generated 906 mutations Killed 400 (44%)
>> Ran 685 tests (0.76 tests per mutation)
================================================================================
- Mutators
================================================================================
> org.pitest.mutationtest.engine.gregor.mutators.MathMutator
>> Generated 53 Killed 26 (49%)
> KILLED 26 SURVIVED 3 TIMED_OUT 0 NON_VIABLE 0 
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0 
> NO_COVERAGE 24 
--------------------------------------------------------------------------------
> org.pitest.mutationtest.engine.gregor.mutators.ConditionalsBoundaryMutator
>> Generated 25 Killed 11 (44%)
> KILLED 11 SURVIVED 2 TIMED_OUT 0 NON_VIABLE 0 
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0 
> NO_COVERAGE 12 
--------------------------------------------------------------------------------
> org.pitest.mutationtest.engine.gregor.mutators.ReturnValsMutator
>> Generated 492 Killed 142 (29%)
> KILLED 142 SURVIVED 42 TIMED_OUT 0 NON_VIABLE 0 
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0 
> NO_COVERAGE 308 
--------------------------------------------------------------------------------
> org.pitest.mutationtest.engine.gregor.mutators.VoidMethodCallMutator
>> Generated 141 Killed 120 (85%)
> KILLED 120 SURVIVED 6 TIMED_OUT 0 NON_VIABLE 0 
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0 
> NO_COVERAGE 15 
--------------------------------------------------------------------------------
> org.pitest.mutationtest.engine.gregor.mutators.IncrementsMutator
>> Generated 9 Killed 6 (67%)
> KILLED 6 SURVIVED 2 TIMED_OUT 0 NON_VIABLE 0 
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0 
> NO_COVERAGE 1 
--------------------------------------------------------------------------------
> org.pitest.mutationtest.engine.gregor.mutators.NegateConditionalsMutator
>> Generated 186 Killed 95 (51%)
> KILLED 95 SURVIVED 15 TIMED_OUT 0 NON_VIABLE 0 
> MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0 
> NO_COVERAGE 76 
--------------------------------------------------------------------------------

BUILD SUCCESSFUL

Total time: 1 mins 35.996 secs

How come the build is successful even though mutations survived?

pitest task fails on dependencies with parent packaged as pom

gradle-pitest-plugin adds to classpath also dependencies packaged as pom which causes PIT to fail.

Exception in thread "main" org.pitest.util.PitError: error in opening zip file (/home/foo/.m2/repository/bar/bar-11.pom)

Please copy and paste the information and the complete stacktrace below when reporting an issue
VM : OpenJDK 64-Bit Server VM
Vendor : Oracle Corporation
Version : 25.5-b02
Uptime : 357
Input -> 
 1 : -Dfile.encoding=UTF-8
BootClassPathSupported : true

    at org.pitest.util.Unchecked.translateCheckedException(Unchecked.java:25)
    at org.pitest.classpath.ArchiveClassPathRoot.getRoot(ArchiveClassPathRoot.java:116)
    at org.pitest.classpath.ArchiveClassPathRoot.getData(ArchiveClassPathRoot.java:45)
    at org.pitest.classpath.CompoundClassPathRoot.getData(CompoundClassPathRoot.java:25)
    at org.pitest.classpath.ClassPath.getClassData(ClassPath.java:100)
    at org.pitest.classpath.ClassPathByteArraySource.getBytes(ClassPathByteArraySource.java:40)
    at org.pitest.classinfo.Repository.querySource(Repository.java:81)
    at org.pitest.classinfo.Repository.nameToClassInfo(Repository.java:67)
    at org.pitest.classinfo.Repository.fetchClass(Repository.java:59)
    at org.pitest.mutationtest.config.ConfigurationFactory.createConfiguration(ConfigurationFactory.java:45)
    at org.pitest.mutationtest.commandline.OptionsParser.setTestConfiguration(OptionsParser.java:420)
    at org.pitest.mutationtest.commandline.OptionsParser.parseCommandLine(OptionsParser.java:388)
    at org.pitest.mutationtest.commandline.OptionsParser.parse(OptionsParser.java:319)
    at org.pitest.mutationtest.commandline.MutationCoverageReport.main(MutationCoverageReport.java:35)
Caused by: java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:220)
    at java.util.zip.ZipFile.<init>(ZipFile.java:150)
    at java.util.zip.ZipFile.<init>(ZipFile.java:164)
    at org.pitest.classpath.ArchiveClassPathRoot.getRoot(ArchiveClassPathRoot.java:114)
    ... 12 more
:zebra:pitest FAILED

gradle pitest failing

VM : Java HotSpot(TM) 64-Bit Server VM
Vendor : Oracle Corporation
Version : 25.65-b01
Uptime : 559
Input ->
1 : -Dfile.encoding=UTF-8
2 : -Duser.country=US
3 : -Duser.language=en
4 : -Duser.variant
BootClassPathSupported : true

at org.pitest.util.Unchecked.translateCheckedException(Unchecked.java:25)
at org.pitest.classpath.ArchiveClassPathRoot.getRoot(ArchiveClassPathRoot.java:116)
at org.pitest.classpath.ArchiveClassPathRoot.getData(ArchiveClassPathRoot.java:45)
at org.pitest.classpath.CompoundClassPathRoot.getData(CompoundClassPathRoot.java:25)
at org.pitest.classpath.ClassPath.getClassData(ClassPath.java:100)
at org.pitest.classpath.ClassPathByteArraySource.getBytes(ClassPathByteArraySource.java:40)
at org.pitest.classinfo.Repository.querySource(Repository.java:81)
at org.pitest.classinfo.Repository.nameToClassInfo(Repository.java:67)
at org.pitest.classinfo.Repository.fetchClass(Repository.java:59)
at org.pitest.mutationtest.config.ConfigurationFactory.createConfiguration(ConfigurationFactory.java:50)
at org.pitest.mutationtest.config.LegacyTestFrameworkPlugin.createTestFrameworkConfiguration(LegacyTestFrameworkPlugin.java:34)
at org.pitest.mutationtest.config.SettingsFactory.getTestFrameworkPlugin(SettingsFactory.java:130)
at org.pitest.mutationtest.config.SettingsFactory.createCoverageOptions(SettingsFactory.java:137)
at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:78)
at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:43)
at org.pitest.mutationtest.commandline.MutationCoverageReport.runReport(MutationCoverageReport.java:72)
at org.pitest.mutationtest.commandline.MutationCoverageReport.main(MutationCoverageReport.java:43)

Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:219)
at java.util.zip.ZipFile.(ZipFile.java:149)
at java.util.zip.ZipFile.(ZipFile.java:163)
at org.pitest.classpath.ArchiveClassPathRoot.getRoot(ArchiveClassPathRoot.java:114)
... 15 more
:MAAS:registration-services:pitest FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':MAAS:registration-services:pitest'.

    Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

Cannot seem to be able to use snapshot versions of pitest with plugin version 0.33

Impacted project here, build file is here. Gradle version 1.12. HOWEVER, see below...

I have modified the build file to be able to use the latest pitest snapshot since it solves an issue that I have. Diff follows:

diff --git a/build.gradle b/build.gradle
index ae39730..743e8d5 100644
--- a/build.gradle
+++ b/build.gradle
@@ -12,6 +12,9 @@ buildscript {
     repositories {
         maven { url "http://repo.spring.io/plugins-release" };
         mavenCentral();
+        maven {
+            url "http://oss.sonatype.org/content/repositories/snapshots/"
+        };
     }
     dependencies {
         classpath(group: "org.springframework.build.gradle", 
@@ -75,6 +78,7 @@ pitest {
     // Since for now it is org.parboiled, we cannot leave the default.
     // By default it is ${project.group}.
     targetClasses = [ "org.parboiled.*", "com.github.parboiled1.*" ];
+    pitestVersion = "0.34-SNAPSHOT";
 }

But unfortunately it fails. Relevant output of ./gradlew --recompile-scripts --stacktrace pitest:

:pitest

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':pitest'.
> Could not resolve org.pitest:pitest-command-line:0.34-SNAPSHOT.
  Required by:
      com.github.parboiled1:grappa:1.0.0-beta.8-SNAPSHOT
   > java.lang.NullPointerException (no error message)

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':pitest'.
    at org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration.rethrowFailure(DefaultLenientConfiguration.java:52)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultResolvedConfiguration.rethrowFailure(DefaultResolvedConfiguration.java:36)
    at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver$FilesAggregatingResolvedConfiguration.rethrowFailure(SelfResolvingDependencyResolver.java:110)
    at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver$ErrorHandlingResolvedConfiguration.rethrowFailure(ErrorHandlingArtifactDependencyResolver.java:180)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:465)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfiguration.java:202)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getFiles(Unknown Source)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext$FileTreeConverter.convertInto(DefaultFileCollectionResolveContext.java:191)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(DefaultFileCollectionResolveContext.java:103)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:75)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext$FileTreeConverter.convertInto(DefaultFileCollectionResolveContext.java:182)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(DefaultFileCollectionResolveContext.java:98)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:75)
    at org.gradle.api.internal.file.CompositeFileCollection$1.resolve(CompositeFileCollection.java:88)
    at org.gradle.api.internal.file.CompositeFileCollection.getSourceCollections(CompositeFileCollection.java:143)
    at org.gradle.api.internal.file.CompositeFileTree.getSourceCollections(CompositeFileTree.java:30)
    at org.gradle.api.internal.file.CompositeFileCollection.getFiles(CompositeFileCollection.java:38)
    at org.gradle.api.internal.changedetection.state.DefaultFileCollectionSnapshotter.snapshot(DefaultFileCollectionSnapshotter.java:48)
    at org.gradle.api.internal.changedetection.rules.InputFilesStateChangeRule.create(InputFilesStateChangeRule.java:33)
    at org.gradle.api.internal.changedetection.rules.TaskUpToDateState.<init>(TaskUpToDateState.java:46)
    at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.getStates(DefaultTaskArtifactStateRepository.java:126)
    at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:69)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:46)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.Main.main(Main.java:37)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
    at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:55)
Caused by: org.gradle.api.internal.artifacts.ivyservice.ModuleVersionResolveException: Could not resolve org.pitest:pitest-command-line:0.34-SNAPSHOT.
Required by:
    com.github.parboiled1:grappa:1.0.0-beta.8-SNAPSHOT
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainDependencyResolver.resolve(RepositoryChainDependencyResolver.java:72)
    at org.gradle.api.internal.artifacts.ivyservice.clientmodule.ClientModuleResolver.resolve(ClientModuleResolver.java:35)
    at org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectDependencyResolver.resolve(ProjectDependencyResolver.java:49)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.LazyDependencyToModuleResolver$AbstractVersionResolveResult.resolve(LazyDependencyToModuleResolver.java:69)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$ModuleVersionResolveState.resolve(DependencyGraphBuilder.java:655)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$ModuleVersionResolveState.getMetaData(DependencyGraphBuilder.java:666)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$DependencyEdge.calculateTargetConfigurations(DependencyGraphBuilder.java:340)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$DependencyEdge.attachToTargetConfigurations(DependencyGraphBuilder.java:314)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:130)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:70)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver$1.execute(DefaultDependencyResolver.java:116)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver$1.execute(DefaultDependencyResolver.java:82)
    at org.gradle.internal.Transformers$3.transform(Transformers.java:131)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyContextManager.java:61)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyContextManager.java:39)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver.resolve(DefaultDependencyResolver.java:82)
    at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.run(CacheLockingArtifactDependencyResolver.java:42)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:187)
    at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:175)
    at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:106)
    at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.useCache(DefaultCacheFactory.java:193)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManager.useCache(DefaultCacheLockingManager.java:65)
    at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver.resolve(CacheLockingArtifactDependencyResolver.java:40)
    at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver.resolve(SelfResolvingDependencyResolver.java:45)
    at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsArtifactDependencyResolver.resolve(ShortcircuitEmptyConfigsArtifactDependencyResolver.java:55)
    at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.resolve(ErrorHandlingArtifactDependencyResolver.java:47)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolve(DefaultConfigurationResolver.java:46)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveNow(DefaultConfiguration.java:240)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:230)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:463)
    ... 61 more
Caused by: java.lang.NullPointerException
    at org.gradle.api.internal.artifacts.repositories.resolver.MavenLocalResolver.isOrphanedPom(MavenLocalResolver.java:49)
    at org.gradle.api.internal.artifacts.repositories.resolver.MavenLocalResolver.findMetaDataArtifact(MavenLocalResolver.java:42)
    at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver.resolveStaticDependency(ExternalResourceResolver.java:165)
    at org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver.getDependency(MavenResolver.java:83)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.LocalModuleVersionRepository.getLocalDependency(LocalModuleVersionRepository.java:44)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.CachedRepository.getLocalDependency(CachedRepository.java:67)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainDependencyResolver$RepositoryResolveState$LocalModuleAccess.getDependency(RepositoryChainDependencyResolver.java:206)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainDependencyResolver$StaticVersionRepositoryResolveState.process(RepositoryChainDependencyResolver.java:228)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainDependencyResolver$RepositoryResolveState.resolve(RepositoryChainDependencyResolver.java:179)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainDependencyResolver.findLatestModule(RepositoryChainDependencyResolver.java:110)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainDependencyResolver.findLatestModule(RepositoryChainDependencyResolver.java:86)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainDependencyResolver.resolve(RepositoryChainDependencyResolver.java:61)
    ... 92 more


BUILD FAILED

That is quite a long stack trace, for sure; but I don't quite like this line:

Caused by: java.lang.NullPointerException

OK, so I tried and downgrade to gradle 1.11; and now the error remains the same but the stacktrace is different! Here it is:

:pitest

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':pitest'.
> Could not find org.pitest:pitest-command-line:0.34-SNAPSHOT.
  Required by:
      com.github.parboiled1:grappa:1.0.0-beta.8-SNAPSHOT

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':pitest'.
    at org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration.rethrowFailure(DefaultLenientConfiguration.java:52)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultResolvedConfiguration.rethrowFailure(DefaultResolvedConfiguration.java:36)
    at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver$FilesAggregatingResolvedConfiguration.rethrowFailure(SelfResolvingDependencyResolver.java:106)
    at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver$ErrorHandlingResolvedConfiguration.rethrowFailure(ErrorHandlingArtifactDependencyResolver.java:176)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:465)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfiguration.java:202)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getFiles(Unknown Source)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext$FileTreeConverter.convertInto(DefaultFileCollectionResolveContext.java:191)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(DefaultFileCollectionResolveContext.java:103)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:75)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext$FileTreeConverter.convertInto(DefaultFileCollectionResolveContext.java:182)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(DefaultFileCollectionResolveContext.java:98)
    at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:75)
    at org.gradle.api.internal.file.CompositeFileCollection$1.resolve(CompositeFileCollection.java:88)
    at org.gradle.api.internal.file.CompositeFileCollection.getSourceCollections(CompositeFileCollection.java:143)
    at org.gradle.api.internal.file.CompositeFileTree.getSourceCollections(CompositeFileTree.java:30)
    at org.gradle.api.internal.file.CompositeFileCollection.getFiles(CompositeFileCollection.java:38)
    at org.gradle.api.internal.changedetection.state.DefaultFileSnapshotter.snapshot(DefaultFileSnapshotter.java:44)
    at org.gradle.api.internal.changedetection.rules.InputFilesStateChangeRule.create(InputFilesStateChangeRule.java:33)
    at org.gradle.api.internal.changedetection.rules.TaskUpToDateState.<init>(TaskUpToDateState.java:46)
    at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.getStates(DefaultTaskArtifactStateRepository.java:126)
    at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:69)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:46)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.Main.main(Main.java:37)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
    at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:55)
Caused by: org.gradle.api.internal.artifacts.ivyservice.ModuleVersionNotFoundException: Could not find org.pitest:pitest-command-line:0.34-SNAPSHOT.
Required by:
    com.github.parboiled1:grappa:1.0.0-beta.8-SNAPSHOT
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.LazyDependencyToModuleResolver$StaticVersionResolveResult.notFound(LazyDependencyToModuleResolver.java:150)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.LazyDependencyToModuleResolver$AbstractVersionResolveResult.resolve(LazyDependencyToModuleResolver.java:91)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$ModuleVersionResolveState.resolve(DependencyGraphBuilder.java:650)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$ModuleVersionResolveState.getMetaData(DependencyGraphBuilder.java:661)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$DependencyEdge.calculateTargetConfigurations(DependencyGraphBuilder.java:337)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$DependencyEdge.attachToTargetConfigurations(DependencyGraphBuilder.java:311)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:127)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:67)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver$1.transform(DefaultDependencyResolver.java:108)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver$1.transform(DefaultDependencyResolver.java:77)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyContextManager.java:61)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver.resolve(DefaultDependencyResolver.java:77)
    at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.create(CacheLockingArtifactDependencyResolver.java:39)
    at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.create(CacheLockingArtifactDependencyResolver.java:37)
    at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:187)
    at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:102)
    at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.useCache(DefaultCacheFactory.java:189)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManager.useCache(DefaultCacheLockingManager.java:61)
    at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver.resolve(CacheLockingArtifactDependencyResolver.java:37)
    at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver.resolve(SelfResolvingDependencyResolver.java:41)
    at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsArtifactDependencyResolver.resolve(ShortcircuitEmptyConfigsArtifactDependencyResolver.java:51)
    at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.resolve(ErrorHandlingArtifactDependencyResolver.java:44)
    at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolve(DefaultConfigurationResolver.java:42)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveNow(DefaultConfiguration.java:240)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:230)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:463)
    ... 61 more

No NPE in 1.11... But whichever version, I cannot seem to be able to use the latest pitest snapshot :/

Support for excludedTestNGGroups option

It seems that gradle plugin does not support excludedTestNGGroups option of pitest.

pitest {
excludedTestNGGroups = ['acceptance', 'integration']
timestampedReports = false
}

....

'excludedTestNGGroups' is not a recognized option

upload latest version to plugins.gradle.org

Would it be possible to upload the latest version and any future versions to the plugins.gradle.org?

https://plugins.gradle.org/plugin/info.solidsoft.pitest

The latest version available on plugins.gradle.org is 1.1.4 and 1.1.10 is missing. It's much easier to use the new plugins syntax.

plugins {
 id "info.solidsoft.pitest" version "1.1.10"
}

I have to resort to using a buildscript classpath dependency in the meantime to get it from maven central.

Need to upgrade to latest version of pitest:1.1.8

We are hitting an issue that gradle pitest seems to hang forever after invoking the junit tests...

Googling a bit, I suspect it is this issue that was present in pitest:1.1.6
and then fixed in version 1.1.7+ :

 https://github.com/hcoles/pitest/issues/231

But I find no gradle-pitest-plugin after 1.1.6 and I suspect that it's still using pitest:1.1.6, correct?

If so, are you planning to upgrade the gradle-plugin to the latest pitest-version?

Or is it possible, somehow, to have the plugin-version:1.1.6
use the latest pitest:1.1.8 ?

Gradle plugin 1.1.4 to PIT 1.1.4 compatibility?

When trying PIT with

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.1.4'
    }
}

in the parent build.gradle and

apply plugin: "info.solidsoft.pitest"

pitest {
    targetClasses = ['com.promo.*']
    pitestVersion = "1.1.4"
    threads = 4
    outputFormats = ['XML', 'HTML']
    excludedMethods = ['equals', 'hashCode']
}

in the module build.gradle

I get the following:

Exception in thread "main" org.pitest.util.PitError: Unable to load class content for org.pitest.boot.HotSwapAgent

Please copy and paste the information and the complete stacktrace below when reporting an issue
VM : Java HotSpot(TM) 64-Bit Server VM
Vendor : Oracle Corporation
Version : 25.31-b07
Uptime : 328
Input -> 
 1 : -Dfile.encoding=windows-1252
 2 : -Duser.country=US
 3 : -Duser.language=en
 4 : -Duser.variant
BootClassPathSupported : true

    at org.pitest.mutationtest.tooling.JarCreatingJarFinder.classBytes(JarCreatingJarFinder.java:124)
    at org.pitest.mutationtest.tooling.JarCreatingJarFinder.addClass(JarCreatingJarFinder.java:113)
    at org.pitest.mutationtest.tooling.JarCreatingJarFinder.createJarFromClassPathResources(JarCreatingJarFinder.java:98)
    at org.pitest.mutationtest.tooling.JarCreatingJarFinder.createJar(JarCreatingJarFinder.java:74)
    at org.pitest.mutationtest.tooling.JarCreatingJarFinder.getJarLocation(JarCreatingJarFinder.java:63)
    at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:70)
    at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:43)
    at org.pitest.mutationtest.commandline.MutationCoverageReport.runReport(MutationCoverageReport.java:72)
    at org.pitest.mutationtest.commandline.MutationCoverageReport.main(MutationCoverageReport.java:43)

When falling back to the

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.1.2'
    }
}

in the parent build.gradle the test run goes through fine.

Is it a compatibility issue or what?

Make dependency exclusion on classpath configurable

Currently some kinds of dependencies (namely *.pom, *.so, *.dll, *.dylib as of 1.1.11) are filtered to not to fail during PIT execution (#52). That list could be made configurable if needed.

As there are some implementation issues to handle it in a flexible way please comment here if you need it in your project.

gradle pitest fails with "cannot find method pitest()"

Howdy,

When running gradle pitest, I get the following error:

> Could not find method pitest() for arguments [...] on root project '...'. 

The relevant stack track confirms the method doesn't seem to exist:

Caused by: org.gradle.api.internal.MissingMethodException:
    Could not find method pitest() for arguments
    [...$_run_closure3@3665c5bf] on root project '...'.

I've copied and pasted the instructions on the README file, verbatim, to my project file.

Update default PIT version due to crashes in 1.1.6

When using version 1.1.6 of the gradle pitest plugin, pit will crash. This is most likely caused by the pit version used in the gradle pitest plugin. There is a known issue reported on version 1.1.6 of pit. Simply changing the version to 1.1.9 solved the issue for me. I don't know if there are any side effects when this is done.

Build not failing when `mutationThreshold` is set

Plugin version: 1.1.11
Java version: 1.8.0_111
Test suite: Unit 4.11
Gradle version: 3.4.1

Expected outcome: Gradle build fails after running pitest task.
Actual outcome: Gradle build succeeds even with 3 mutations passing and mutationThreshold set to 0 or 1

Exception thrown when no tests in project

I would like to just apply the pitest plugin to 'allprojects', but not all of my subprojects have tests.

I get:

org.pitest.help.PitHelpError: No mutations found. This probably means there is an issue with either the supplied classpath or filters.
See http://pitest.org for more details.
    at org.pitest.mutationtest.tooling.MutationCoverage.checkMutationsFound(MutationCoverage.java:272)
    at org.pitest.mutationtest.tooling.MutationCoverage.runReport(MutationCoverage.java:136)
    at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:103)
    at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:45)
    at org.pitest.mutationtest.commandline.MutationCoverageReport.runReport(MutationCoverageReport.java:76)
    at org.pitest.mutationtest.commandline.MutationCoverageReport.main(MutationCoverageReport.java:45)

Not very obvious error

I just got this error:

> No mutations found. This probably means there is an issue with either the supplied classpath or filters.
  See http://pitest.org for more details.

It was because I didn't have ${project.group} set, however there is nothing in the output to state this. Even just a line of "Project.group was = null" would have sped up debugging

Provide a way to configure pitest version AND its dependencies

At the moment, the plugin exposes pitestVersion property which allows to change the pitest version used, but it is not (easily) possible to change versions if pitest dependencies.

For example, pitest 1.1.0 declares dependency to org.testng:testng:6.1.1 but I want to use (the latest) org.testng:testng:6.8.8 because of reasons.

The plugin creates an invisible pitest configuration at https://github.com/szpak/gradle-pitest-plugin/blob/master/src/main/groovy/info/solidsoft/gradle/pitest/PitestPlugin.groovy#L69, so I believe that simply changing the configuration visibility will allow to override the pitest dependencies.

I am also not sure whether the configuration should be created in the "buildscript" project or in the project being tested.

pitest task is always up-to-date when groovyc is used to compile Java classes

pitest task is never run by Gradle with the following explanation:

:pitest
Skipping task ':pitest' as it has no source files.

when groovyc is used to compile Java classes (needed when bidirectional Groovy<->Java dependencies exist):

sourceSets {
    main {
        java { srcDirs = [] }
        groovy { srcDir "src/main/java" }
    }
}

Question on tags

Looks like the latest version is 0.33 but I see your last tag was 0.30 any reason? Which version is recommended

Control for timestamped reports

Currently, all reports output by the pitest plugin go into a timestamped directory under reportDir. The Maven plugin has an option timestampedReports that allows for control of this mechanism to better allow for automation around these reports. This is a feature request asking to port timestampedReports to the Gradle plugin.

JDK-8 support

Hey,

I am using the gradle-pitest-plugin under JDK-8 with Gradle-1.11. Here is my declaration from build.gradle:

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath 'org.springframework.boot:spring-boot-gradle-plugin:' + springBootVersion
    classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:0.32.0'
  }
}

pitest {
  //dependencies {
  //  compile 'org.ow2.asm:asm:5.0'
  //}

  pitestVersion = "0.33"
}

The test execution fails with the following exception:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':dashboard-server:pitest'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
    at org.gradle.launcher.Main.doAction(Main.java:46)
    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
    at org.gradle.launcher.Main.main(Main.java:37)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
Caused by: java.lang.IllegalArgumentException
    at org.pitest.reloc.asm.ClassReader.<init>(Unknown Source)
    at org.pitest.reloc.asm.ClassReader.<init>(Unknown Source)
    at org.pitest.classinfo.ClassInfoVisitor.getClassInfo(ClassInfoVisitor.java:39)
    at org.pitest.classinfo.Repository.nameToClassInfo(Repository.java:69)
    at org.pitest.classinfo.Repository.fetchClass(Repository.java:59)
    at org.pitest.classinfo.NameToClassInfo.apply(NameToClassInfo.java:15)
    at org.pitest.classinfo.NameToClassInfo.apply(NameToClassInfo.java:6)
    at org.pitest.functional.FCollection.flatMapTo(FCollection.java:56)
    at org.pitest.functional.FCollection.flatMap(FCollection.java:66)
    at org.pitest.classpath.CodeSource.getCode(CodeSource.java:46)
    at org.pitest.mutationtest.verify.DefaultBuildVerifier.verify(DefaultBuildVerifier.java:31)
    at org.pitest.mutationtest.tooling.MutationCoverage.verifyBuildSuitableForMutationTesting(MutationCoverage.java:212)
    at org.pitest.mutationtest.tooling.MutationCoverage.runReport(MutationCoverage.java:116)
    at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:100)
    at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:42)
    at org.pitest.mutationtest.commandline.MutationCoverageReport.runReport(MutationCoverageReport.java:69)
    at org.pitest.mutationtest.commandline.MutationCoverageReport.main(MutationCoverageReport.java:41)
    at org.pitest.mutationtest.commandline.MutationCoverageReport$main.call(Unknown Source)
    at info.solidsoft.gradle.pitest.PitestTask.run(PitestTask.groovy:172)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:219)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:212)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:201)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:533)
    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:516)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    ... 43 more

I already read some blog posts and it seems like this problem relates to an invalid ASM library. I tried to declare a dependency directly to the pitest task but that does not help. On my default class path there is an ASM library version 3.3.1 because of a transitive dependency of QueryDSL.

pitest - The Pitest libraries to be used for this project.
\--- org.pitest:pitest-command-line:0.33
     \--- org.pitest:pitest:0.33
          +--- junit:junit:4.10
          |    \--- org.hamcrest:hamcrest-core:1.1
          \--- org.testng:testng:6.1.1
               +--- junit:junit:3.8.1 -> 4.10 (*)
               +--- org.beanshell:bsh:2.0b4
               +--- com.beust:jcommander:1.12
               \--- org.yaml:snakeyaml:1.6

I noticed that the 'pitest' classpath does not include a specific ASM version.

Any advice would be pretty much appreciated.

Ability to disable PIT execution in specified subprojects

PIT doesn't like modules with no code or only with interfaces. It would be useful to have an ability to disable pitest task execution for selected modules (simple enabled/skip flag).

As a workaround -x module1:pitest can be used.

Exception thrown when dynamic libs (.so, .dll, .dylib) are in gradle project classpath.

I'm recieving the following pi-test exception when I have local dynamoDB (sqlite4java) lib files in my java project with a gradle build. Seems "Pitest gradle plugin" tries to open the lib files in class path and fails on .so file.
Could not find a way to exclude lib files from pi-test either (excludedClasses etc. does not work for .so, .dll, .dylib files even though I excluded "com.almworks.sqlite4java". Still tries to uncompress them).

Exception in thread "main" org.pitest.util.PitError: error in opening zip file (/Users/user1/.gradle/caches/modules-2/files-2.1/com.almworks.sqlite4java/libsqlite4java-linux-i386/1.0.392/b193c62571061e68bddeaf8ee7d3a8569b945ea6/libsqlite4java-linux-i386-1.0.392.so)

Please copy and paste the information and the complete stacktrace below when reporting an issue
VM : Java HotSpot(TM) 64-Bit Server VM
Vendor : Oracle Corporation
Version : 25.102-b14
Uptime : 323
Input ->
 1 : -Dfile.encoding=UTF-8
 2 : -Duser.country=US
 3 : -Duser.language=en
 4 : -Duser.variant
BootClassPathSupported : true

        at org.pitest.util.Unchecked.translateCheckedException(Unchecked.java:25)
        at org.pitest.classpath.ArchiveClassPathRoot.getRoot(ArchiveClassPathRoot.java:120)
        at org.pitest.classpath.ArchiveClassPathRoot.getData(ArchiveClassPathRoot.java:46)
        at org.pitest.classpath.CompoundClassPathRoot.getData(CompoundClassPathRoot.java:27)
        at org.pitest.classpath.ClassPath.getClassData(ClassPath.java:97)
        at org.pitest.classpath.ClassPathByteArraySource.getBytes(ClassPathByteArraySource.java:41)
        at org.pitest.classinfo.Repository.querySource(Repository.java:82)
        at org.pitest.classinfo.Repository.nameToClassInfo(Repository.java:68)
        at org.pitest.classinfo.Repository.fetchClass(Repository.java:60)
        at org.pitest.mutationtest.config.ConfigurationFactory.createConfiguration(ConfigurationFactory.java:50)
        at org.pitest.mutationtest.config.LegacyTestFrameworkPlugin.createTestFrameworkConfiguration(LegacyTestFrameworkPlugin.java:36)
        at org.pitest.mutationtest.config.SettingsFactory.getTestFrameworkPlugin(SettingsFactory.java:132)
        at org.pitest.mutationtest.config.SettingsFactory.createCoverageOptions(SettingsFactory.java:140)
        at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:80)
        at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:45)
        at org.pitest.mutationtest.commandline.MutationCoverageReport.runReport(MutationCoverageReport.java:87)
        at org.pitest.mutationtest.commandline.MutationCoverageReport.main(MutationCoverageReport.java:45)
Caused by: java.util.zip.ZipException: error in opening zip file
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:219)
        at java.util.zip.ZipFile.<init>(ZipFile.java:149)
        at java.util.zip.ZipFile.<init>(ZipFile.java:163)
        at org.pitest.classpath.ArchiveClassPathRoot.getRoot(ArchiveClassPathRoot.java:118)
        ... 15 more
:pitest FAILED

Suggestion: Clarify how to make pitest depending on build

I was having a bit of a problem when trying to make build depend on pitest. Like this:

build.dependsOn pitest

It has to be done like this:

build.dependsOn "pitest"

Because the pitest task has the same name as the configuration.

This is just a suggestion to mention that in the README.md. Or just close the issue if you dont think its important.

Android support

I was trying to add this one to an android project and Gradle fails.

./gradlew pitest
Parallel execution with configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':module'.
> The 'java' plugin has been applied, but it is not compatible with the Android plugins.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Are there any plans on supporting android?

TestNG groups exclusion is not supported

Observed for pitest plugin 1.1.4; pitest 1.1.5

According to test on http://gradle-pitest-plugin.solidsoft.info/ "All the command line options are supported." but actually adding "includedTestNGGroups" to pitest configuration closure leads to exception "No such property: excludedTestNGGroups for class: info.solidsoft.gradle.pitest.PitestPluginExtension_Decorated".

Note, that "excludedGroups" is not working for TestNG groups as well.

An ability to use tests from an another source set

Currently gradle-pitest-plugin uses only tests available in test source set. Sometimes it is useful to put some tests (e.g. integration tests) into another source set. The plugin should allow to specify another source set(s) to use in mutation testing.

An enhancement reported originally by Abdulkadir Yaman.

Unable to resolve pitest-command-line - no repositories defined

The gradle-pitest-plugin fails when used in a subproject of a multi-project build unless the root project has mavenCentral() defined as a buildscript repository - even if the subproject itself has mavenCentral() defined as a buildscript repository. Depending on the version of Gradle and the circumstances of the build scripts, it may either give a simple "could not resolve pitest-command-line" error, or it may include a message about how there are no repositories defined.

In case my description isn't clear enough, I set up a basic gradle project to demonstrate (https://dl.dropboxusercontent.com/u/3202601/Gradle-Pitest-Example.zip). Running 'gradle pitest' in the pitest-plugin-test subproject will fail to resolve the dependency. If you add "buildscript.repositories.mavenCentral()" to the buildscript in the root project, it will resolve normally.

This is confusing and counter-intuitive - if a user is not aware of this requirement, it appears as though appropriate repositories are defined. If this is intentional, it should at least be documented.

While I was trying to figure it out, I tried older versions of this plugin and found that version 0.33.0 works as expected, but version 1.0.0 and all later versions do not.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.