szpak / gradle-pitest-plugin

Gradle plugin for PIT Mutation Testing
http://gradle-pitest-plugin.solidsoft.info/
212 stars 57 forks source link

JUnit was not found on the classpath. PIT requires JUnit 4.6 #236

Closed avinashgv closed 3 years ago

avinashgv commented 3 years ago

I have root build.gradle and a subproject. Based on the recommendation for 1.5.1, i have configured the subproject as below:

plugins {
    id 'java-application'
    id 'info.solidsoft.pitest' version '1.5.1'
}

pitest {
    targetClasses = ['com.test.*']
    pitestVersion = "1.5.1"
    outputFormats = ['HTML']
    timestampedReports = false
    verbose = true
    junit5PluginVersion = '0.12'
}

However i see the following error:

7:12:36 PM PIT >> INFO : MINION : 7:12:36 PM PIT >> SEVERE : JUnit was not found on the classpath. PIT requires JUnit 4.6 or above. See http://pitest.org for more details.

7:12:36 PM PIT >> SEVERE : Error generating coverage. Please check that your classpath contains modern JUnit 4 or PIT test plugin for other test tool (JUnit 5, TestNG, ...) is enabled. Exception in thread "main" org.pitest.util.PitError: Coverage generation minion exited abnormally. Please check the classpath and/or enable test plugin for used test tool.

szpak commented 3 years ago

It should work :). There is a functional test with multiproject build which you can compare with the configuration you have.

I assume, there could be some problem with the way how/when you applies configuration. Could you paste wider code fragment with subproject {}. In addition you may run the pitest task with -i and paste the parameters passed to PIT (especially the classpath which is used).

Btw, it shouldn't matter, but please upgrade to the latest gradle-pitest-plugin 1.5.2.

avinashgv commented 3 years ago

Thanks for your quick response, Marcin :) @szpak I have updated the plugin to 1.5.2

Here are the classpath details:

Starting process 'command '/usr/lib/jvm/java-8-openjdk-amd64/bin/java''. Working directory: /home/vagrant/workspace/service Command: /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Dawt.toolkit=sun.awt.X11.XToolkit -Dfile.encoding.pkg=sun.io -Dfile.separator=/ -Djava.awt.graphicsenv=sun.awt.X11GraphicsEnvironment -Djava.awt.printerjob=sun.print.PSPrinterJob -Djava.class.path=/home/vagrant/.gradle/wrapper/dists/gradle-6.0.1-all/4mhcz522p8xz8cwc73c0dfue/gradle-6.0.1/lib/gradle-launcher-6.0.1.jar -Djava.class.version=52.0 -Djava.endorsed.dirs=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/endorsed -Djava.ext.dirs=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext:/usr/java/packages/lib/ext -Djava.home=/usr/lib/jvm/java-8-openjdk-amd64/jre -Djava.library.path=/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib -Djava.runtime.name=OpenJDK Runtime Environment -Djava.runtime.version=1.8.0_252-8u252-b09-1~18.04-b09 -Djava.specification.name=Java Platform API Specification -Djava.specification.vendor=Oracle Corporation -Djava.specification.version=1.8 -Djava.vendor=Private Build -Djava.vendor.url=http://java.oracle.com/ -Djava.vendor.url.bug=http://bugreport.sun.com/bugreport/ -Djava.version=1.8.0_252 -Djava.vm.info=mixed mode -Djava.vm.name=OpenJDK 64-Bit Server VM -Djava.vm.specification.name=Java Virtual Machine Specification -Djava.vm.specification.vendor=Oracle Corporation -Djava.vm.specification.version=1.8 -Djava.vm.vendor=Private Build -Djava.vm.version=25.252-b09 -Dlibrary.jansi.path=/home/vagrant/.gradle/native/jansi/1.18/linux64 -Dline.separator= -Dorg.gradle.appname=gradlew -Dos.arch=amd64 -Dos.name=Linux -Dos.version=4.15.0-54-generic -Dpath.separator=: -Dsun.arch.data.model=64 -Dsun.boot.class.path=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/resources.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/rt.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jsse.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jce.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/charsets.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jfr.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/classes -Dsun.boot.library.path=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64 -Dsun.cpu.endian=little -Dsun.cpu.isalist -Dsun.desktop=gnome -Dsun.io.unicode.encoding=UnicodeLittle -Dsun.java.command=org.gradle.launcher.daemon.bootstrap.GradleDaemon 6.0.1 -Dsun.java.launcher=SUNSTANDARD -Dsun.jnu.encoding=UTF-8 -Dsun.management.compiler=HotSpot 64-Bit Tiered Compilers -Dsun.os.patch.level=unknown -Duser.dir=/home/vagrant/workspace/service/ -Duser.home=/home/vagrant -Duser.name=vagrant -Duser.timezone -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/tmp -Duser.country=US -Duser.language=en -Duser.variant -cp /home/vagrant/.gradle/caches/modules-2/files-2.1/org.pitest/pitest-command-line/1.5.2/ff560190599e16a593a08c9758cd919832b36fa1/pitest-command-line-1.5.2.jar:/home/vagrant/.gradle/caches/modules-2/files-2.1/org.pitest/pitest-entry/1.5.2/4947ba5180fe790177a703470d1765256243436f/pitest-entry-1.5.2.jar:/home/vagrant/.gradle/caches/modules-2/files-2.1/org.pitest/pitest/1.5.2/9a05e244abe423b3d0e6c9247d50fe02f63f01e0/pitest-1.5.2.jar org.pitest.mutationtest.commandline.MutationCoverageReport --reportDir=/home/vagrant/workspace/service/build/reports/pitest --targetClasses=com.test. --targetTests=com.test. --outputFormats=HTML --sourceDirs=/home/vagrant/workspace/service/src/main/resources,/home/vagrant/workspace/service/src/main/java --timestampedReports=false --mutableCodePaths=/home/vagrant/workspace/service/build/classes/java/main --includeLaunchClasspath=false --classPath=/home/vagrant/workspace/service/build/classes/java/test,/home/vagrant/workspace/service/build/resources/test,/home/vagrant/workspace/service/build/classes/java/main,/home/vagrant/workspace/service/build/resources/main,/home/vagrant/.gradle/caches/modules-2/files-2.1/org.codehaus.janino/janino/3.1.2/49961f7c8a31c8d1019be19c37df1362a7d1ece3/janino-3.1.2.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut.security/micronaut-security-jwt/2.0.0/b259c5b0639a32c39164339158555090474626b5/micronaut-security-jwt-2.0.0.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut.security/micronaut-security-annotations/2.0.0/216c7831f15cb12265454d62816caa6d384086f/micronaut-security-annotations-2.0.0.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut.security/micronaut-security/2.0.0/2ba208f6f110c217f99b1edaa9f769a8c6ec5b8f/micronaut-security-2.0.0.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.3/7c4f3c474fb2c041d8028740440937705ebb473a/logback-classic-1.2.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-http-client/2.0.3/319375271e322d15d3349395d3d86d69f491ce59/micronaut-http-client-2.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-http-server-netty/2.0.3/63cf4f04125322a849a31ea9dd5a4a81e5b67ec5/micronaut-http-server-netty-2.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-management/2.0.3/2baece0467db4ad47842f71173c29e1ab1b272a1/micronaut-management-2.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-http-client-core/2.0.3/ba37854987df79fd54ad557c93c1694b575d684e/micronaut-http-client-core-2.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-http-server/2.0.3/4540fb677f6f4c57b826791aca1b517f5f80e3a6/micronaut-http-server-2.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-runtime/2.0.3/6988a6109a53e606cfd5eb68600ec7ad888a88c3/micronaut-runtime-2.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-validation/2.0.3/30415640ff046831f4bebd5c6ef5017e47bbbb00/micronaut-validation-2.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-http-netty/2.0.3/500b9a05497433246db608ae69257147fa9ad161/micronaut-http-netty-2.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-websocket/2.0.3/81a540a2e30d5b59f542674bd475c640a53a3b54/micronaut-websocket-2.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-router/2.0.3/a0a753932c639fac4e08b444f09d9a7d82966811/micronaut-router-2.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-http/2.0.3/47e13673e75e0363d0ee8a6f8d5e3278c80e588d/micronaut-http-2.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-aop/2.0.3/c0c59d481287e61d378009f99c1b111dc7d98ea2/micronaut-aop-2.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-buffer-netty/2.0.3/9be14beffd925c9e48f7ff9af99b46e7c17cbeda/micronaut-buffer-netty-2.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-inject/2.0.3/6d3902c1e17bd2d6e7b5a880021f8275ff75ee5d/micronaut-inject-2.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/software.amazon.awssdk/auth/2.10.45/32b68a3d82bc121f739774cd7ec8da02acc9dfbe/auth-2.10.45.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/software.amazon.awssdk/regions/2.10.45/9a583ab343bf6a24bd48a9b2c48cdefd7f5839aa/regions-2.10.45.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/software.amazon.awssdk/sdk-core/2.10.45/71fa32b6012fe68afeab24fdcec596a7771162b5/sdk-core-2.10.45.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/software.amazon.awssdk/profiles/2.10.45/ebe2c85bd24e4b9102a52202753e2aa2659bd790/profiles-2.10.45.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/software.amazon.awssdk/http-client-spi/2.10.45/6aa4863e744d7978502ad79e59b8ced3c5380ac0/http-client-spi-2.10.45.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/software.amazon.awssdk/utils/2.10.45/c3121398623d189b87f7cb20768ace482e41417a/utils-2.10.45.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.micronaut/micronaut-core/2.0.3/37dcfa78c9f41cddeebeb33fd5cb08b282f01966/micronaut-core-2.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/1.7.26/77100a62c2e6f04b53977b9f541044d7d722693d/slf4j-api-1.7.26.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/net.logstash.logback/logstash-logback-encoder/6.3/79468d3566f9cf837fa3805dd2de057002d4ea04/logstash-logback-encoder-6.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/org.assertj/assertj-core/3.11.1/fdac3217b804d6900fa3650f17b5cb48e620b140/assertj-core-3.11.1.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-engine/1.6.2/1752cad2579e20c2b224602fe846fc660fb35805/junit-platform-engine-1.6.2.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-commons/1.6.2/7644a14b329e76b5fe487628b50fb5eab6ba7d26/junit-platform-commons-1.6.2.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter-engine/5.6.0/83c9e737f6015d9e00029b9b1d51e952a884b8f9/junit-jupiter-engine-5.6.0.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/org.mockito/mockito-junit-jupiter/2.22.0/221e1bc0c1f9f80b0e6812513b32e17a9def1e1b/mockito-junit-jupiter-2.22.0.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter-api/5.6.0/f29e6318333d2303ce4965c9819cfad08de7d1e5/junit-jupiter-api-5.6.0.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/javax.annotation/javax.annotation-api/1.3.2/934c04d3cfef185a8008e7bf34331b79730a9d43/javax.annotation-api-1.3.2.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/com.github.spotbugs/spotbugs-annotations/4.0.3/755cc5d84d32b31beeaf8597181f0fc4eac98e16/spotbugs-annotations-4.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.2/25ea2e8b0c338a877313bd4672d3fe056ea78f0d/jsr305-3.0.2.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.26/a78a8747147d2c5807683e76ec2b633e95c14fe9/snakeyaml-1.26.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.reactivex.rxjava2/rxjava/2.2.10/18e9edc67e0abaa03713eeb9ca2cb0e30c859de4/rxjava-2.2.10.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/org.reactivestreams/reactive-streams/1.0.3/d9fb7a7926ffa635b3dcaa5049fb2bfa25b3e7d0/reactive-streams-1.0.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/javax.validation/validation-api/2.0.1.Final/cb855558e6271b1b32e716d24cb85c7f583ce09e/validation-api-2.0.1.Final.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/software.amazon.awssdk/annotations/2.10.45/5907b8f2992c72972a3ef12e2c0ad70a9683951d/annotations-2.10.45.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.datatype/jackson-datatype-jdk8/2.11.2/d4c1933a8d62db65c3d5a5cd809511e021a189c0/jackson-datatype-jdk8-2.11.2.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.11.2/e6235e5eb3cf3edd2a95cd0dc96bc48aeb309e8a/jackson-datatype-jsr310-2.11.2.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.11.2/ee08bbd8975dde844307fe8309dfcd5ec7ee129d/jackson-databind-2.11.2.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/software.amazon.eventstream/eventstream/1.0.1/6ff8649dffc5190366ada897ba8525a836297784/eventstream-1.0.1.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/org.apiguardian/apiguardian-api/1.1.0/fc9dff4bb36d627bdc553de77e1f17efd790876c/apiguardian-api-1.1.0.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/org.opentest4j/opentest4j/1.2.0/28c11eb91f9b6d8e200631d46e20a7f407f2a046/opentest4j-1.2.0.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/org.mockito/mockito-core/2.22.0/73d21198eea9e20af8e55260ec131b6fea9de917/mockito-core-2.22.0.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/org.codehaus.janino/commons-compiler/3.1.2/e6944b15d2b3964ebd3c520c6bd26cbb4f614910/commons-compiler-3.1.2.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-core/1.2.3/864344400c3d4d92dfeb0a305dc87d953677c03c/logback-core-1.2.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.netty/netty-handler-proxy/4.1.48.Final/79910203db6a542189c9aaa9ec187bf5ee16248a/netty-handler-proxy-4.1.48.Final.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-http2/4.1.48.Final/f7a0e40d0eea9a60c05f705a128473f08a3de1dc/netty-codec-http2-4.1.48.Final.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-http/4.1.48.Final/8b18499a51367d291efd1f200a4e865370d38738/netty-codec-http-4.1.48.Final.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-socks/4.1.48.Final/42b55c9ca8672ebb7160cadf3c70ffc11638f021/netty-codec-socks-4.1.48.Final.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.netty/netty-handler/4.1.48.Final/d459919c87dc1a2bf400b39053761ecc11c2e436/netty-handler-4.1.48.Final.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec/4.1.48.Final/3142078325d745228da9d6d1f6f9931c63aaba16/netty-codec-4.1.48.Final.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport/4.1.48.Final/d285e8d9af5be1fc146b91a1b0d211e7a6a7e7d4/netty-transport-4.1.48.Final.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.netty/netty-buffer/4.1.48.Final/7fd3ebb659c628e0158c9c2c971f4d0734d7f4f0/netty-buffer-4.1.48.Final.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.netty/netty-resolver/4.1.48.Final/612ad2acc848ce46496095683eea621094763b80/netty-resolver-4.1.48.Final.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/io.netty/netty-common/4.1.48.Final/ec27d04fd5e7b65ac171cd64734f9e4f1fc2a286/netty-common-4.1.48.Final.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-annotations/2.11.2/e0a7f61fce3e3eac38a079c11831868269de2ea/jackson-annotations-2.11.2.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.11.2/bc022ab0f0c83c07f9c52c5ab9a6a4932b15cc35/jackson-core-2.11.2.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/javax.inject/javax.inject/1/6975da39a7040257bd51d21a231b76c915872d38/javax.inject-1.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/com.nimbusds/nimbus-jose-jwt/8.19/d3b8f83ba42e2f60aa4cc0cac0b31fc5ccebf3c1/nimbus-jose-jwt-8.19.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy/1.8.21/3589ecd78aa4b1e1c1e1505d0321e93a9b73ca54/byte-buddy-1.8.21.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy-agent/1.8.21/5b652c6c6645dfb27fdf96bf3f6d12b7b3818344/byte-buddy-agent-1.8.21.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/org.objenesis/objenesis/2.6/639033469776fd37c08358c6b92a4761feb2af4b/objenesis-2.6.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/com.github.stephenc.jcip/jcip-annotations/1.0-1/ef31541dd28ae2cefdd17c7ebf352d93e9058c63/jcip-annotations-1.0-1.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/net.minidev/json-smart/2.3/7396407491352ce4fa30de92efb158adb76b5b/json-smart-2.3.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/net.minidev/accessors-smart/1.2/c592b500269bfde36096641b01238a8350f8aa31/accessors-smart-1.2.jar,/home/vagrant/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm/5.0.4/da08b8cce7bbf903602a25a3a163ae252435795/asm-5.0.4.jar_ Successfully started process 'command '/usr/lib/jvm/java-8-openjdk-amd64/bin/java'' 9:28:21 PM PIT >> INFO : Verbose logging is disabled. If you encounter a problem, please enable it before reporting an issue. 9:28:21 PM PIT >> INFO : Sending 10 test classes to minion 9:28:21 PM PIT >> INFO : Sent tests to minion 9:28:22 PM PIT >> SEVERE : Error generating coverage. Please check that your classpath contains modern JUnit 4 or PIT test plugin for other test tool (JUnit 5, TestNG, ...) is enabled. Exception in thread "main" org.pitest.util.PitError: Coverage generation minion exited abnormally. Please check the classpath and/or enable test plugin for used test tool.

avinashgv commented 3 years ago

Also, as indicated in the functional test i have added the following dependency:

dependencies { testImplementation 'junit:junit:5.0' }

This addressed the above error, however I see that mutations are not killed:

Generated 1 Killed 0 (0%) KILLED 0 SURVIVED 0 TIMED_OUT 0 NON_VIABLE 0 MEMORY_ERROR 0 NOT_STARTED 0 STARTED 0 RUN_ERROR 0 NO_COVERAGE 1

================================================================================

  • Timings

    scan classpath : < 1 second coverage and dependency analysis : < 1 second build mutation tests : < 1 second run mutation analysis : < 1 second

    Total : 1 seconds

    ================================================================================

  • Statistics

    Generated 1 mutations Killed 0 (0%) Ran 0 tests (0 tests per mutation)

Appreciate your help on this. @szpak

szpak commented 3 years ago

Strange. There is no pitest-junit5 dependency added. When running with -i you should see Implicitly using JUnit 5 plugin for PIT with version defined in 'junit5PluginVersion' in logs, but looking at the execution command line most likely you also don't have it. Could you verify that?

Please paste all pitest related configuration in your .gradle files. Including the scope it is applied (subprojects {} or allproject {}). You can skip the part which is not pitest related. I still suspect there is something wrong with the configuration.

Btw, it should not be a problem (5.6+ is regularly tested for common scenarios), but you could also give upgrading Gradle to the never version a try.

avinashgv commented 3 years ago

I don't see the log message. As expected, i believe the plugin is not getting picked. In the root build.gradle file, i don't have anything related to pitest configuration. In the sub-module project as mentioned before i have the plugin configuration as below:

plugins { id("com.test.java-application") id ("info.solidsoft.pitest") version "1.5.2" }

dependencies { } - This has some test dependencies and logging dependencies.

pitest { targetClasses = ['com.test.*'] outputFormats = ['HTML'] timestampedReports = false junit5PluginVersion = '0.12' }

Please let me know if you need any further details. Thank you @szpak

avinashgv commented 3 years ago

Hi @szpak , Here is the sub-project code snippet:

subprojects { //Enforce restrictions based on BOM project if (name != "bom" && name != "distribution" && (parent?.name != "distribution" || name == "devops-sample")) { afterEvaluate { dependencies {
add("api", enforcedPlatform(project(":bom"))) add("implementation", enforcedPlatform(project(":bom"))) add("annotationProcessor", enforcedPlatform(project(":bom"))) add("testImplementation", enforcedPlatform(project(":bom"))) add("integTestImplementation", enforcedPlatform(project(":bom"))) add("integTestAnnotationProcessor", enforcedPlatform(project(":bom"))) add("compile", enforcedPlatform(project(":bom"))) add("compileOnly", enforcedPlatform(project(":bom"))) add("runtime", enforcedPlatform(project(":bom"))) add("runtimeOnly", enforcedPlatform(project(":bom"))) add("testCompile", enforcedPlatform(project(":bom"))) add("testCompileOnly", enforcedPlatform(project(":bom"))) add("testRuntimeOnly", enforcedPlatform(project(":bom"))) add("integTestCompile", enforcedPlatform(project(":bom"))) add("integTestCompileOnly", enforcedPlatform(project(":bom"))) add("integTestRuntimeOnly", enforcedPlatform(project(":bom"))) } } } }

avinashgv commented 3 years ago

@szpak Please let me know if you need any further details.

szpak commented 3 years ago

I went it over and the only idea I have is something that sat in your project which breaks the execution. From that code, only the first method seems to be executed, but for some reason if (extension.junit5PluginVersion.isPresent()) { returns false. You state that pitest { junit5PluginVersion = '0.12' } is used which should evaluate to true.

I've generated a simple multiproject build with PIT and JUnit 5 and everything works fine:

$ gw pitest -i --rerun-tasks
...
> Configure project :sub1
Evaluating project ':sub1' using build file '/tmp/multi-pit/sub1/build.gradle'.
All projects evaluated.
Using PIT: 1.5.2
Implicitly using JUnit 5 plugin for PIT with version defined in 'junit5PluginVersion'
Adding dependency: org.pitest:pitest-junit5-plugin:0.12
...
================================================================================
- Statistics
================================================================================
>> Generated 3 mutations Killed 2 (67%)
>> Ran 4 tests (1.33 tests per mutation)

I propose you to gradually add things from your project to mine to determine what breaks the pitest task execution.

avinashgv commented 3 years ago

Thanks @szpak . As mentioned by you, the plugin works properly on the sample project. I will try to add the things gradually to understand the issue further.

avinashgv commented 3 years ago

Thanks @szpak . The changes suggested in sample project helped in resolving the issue.