Open kphannan opened 2 years ago
After doing some digging through internet searches I stumbled on a post noting there is a dependency needed.
testRuntimeOnly 'org.pitest:pitest-junit5-plugin:0.15'
After adding the dependency the mutation tests ran. This could be an issue with the PiTest Gradle plugin instead of PiTest itself.
To use PIT with JUnit 5 you need pitest-junit5-plugin as a dependency or you can ask the Gradle plugin to do it for you, as mentioned in the FAQ:
plugins {
id 'java'
id 'info.solidsoft.pitest' version '1.7.0'
}
pitest {
//adds dependency to org.pitest:pitest-junit5-plugin and sets "testPlugin" to "junit5"
junit5PluginVersion = '0.15' //or 0.14 for Junit Jupiter 5.7 (JUnit Platform 1.7)
// ...
}
Nevertheless, you should get some nicer error and a suggestion about adding some PIT plugin for TestNG or JUnit 5 instead of:
java.lang.NoClassDefFoundError: org/junit/runner/manipulation/Filter
@hcoles Might it be some regression in 1.7.x? I was improving the error message in https://github.com/hcoles/pitest/pull/745, so probably it was displayed in the past.
Included are versions of Java, Gradle and the verbose output from PiTest.
This was a clean build with JUnit 5.8.2 based unit tests.
If needed I can put the entire project into GitHub for access to the entire codebase. It is just prototype code being used to demonstrate some design and coding, nothing proprietary. the project is relatively small 33 total source files including unit tests.
-------- Begin console output ------------
➜ basics git:(feature/improve-strategy-tests) ✗ gradle -v executing gradlew instead of gradle
Gradle 7.3.3
Build time: 2021-12-22 12:37:54 UTC Revision: 6f556c80f945dc54b50e0be633da6c62dbe8dc71
Kotlin: 1.5.31 Groovy: 3.0.9 Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021 JVM: 17 (Eclipse Adoptium 17+35) OS: Mac OS X 11.1 x86_64
➜ basics git:(feature/improve-strategy-tests) ✗ java -version openjdk version "17" 2021-09-14 OpenJDK Runtime Environment Temurin-17+35 (build 17+35) OpenJDK 64-Bit Server VM Temurin-17+35 (build 17+35, mixed mode, sharing) ➜ basics git:(feature/improve-strategy-tests) ✗ gradle check jacocoTestReport pitest executing gradlew instead of gradle
Please copy and paste the information and the complete stacktrace below when reporting an issue VM : OpenJDK 64-Bit Server VM Vendor : Eclipse Adoptium Version : 17+35 Uptime : 973 Input -> 1 : -Dfile.encoding=UTF-8 2 : -Duser.country=US 3 : -Duser.language=en 4 : -Duser.variant BootClassPathSupported : false
Please copy and paste the information and the complete stacktrace below when reporting an issue VM : OpenJDK 64-Bit Server VM Vendor : Eclipse Adoptium Version : 17+35 Uptime : 974 Input -> 1 : -Dfile.encoding=UTF-8 2 : -Duser.country=US 3 : -Duser.language=en 4 : -Duser.variant BootClassPathSupported : false
Caused by: org.pitest.util.PitError: Coverage generation minion exited abnormally!
Please copy and paste the information and the complete stacktrace below when reporting an issue VM : OpenJDK 64-Bit Server VM Vendor : Eclipse Adoptium Version : 17+35 Uptime : 973 Input -> 1 : -Dfile.encoding=UTF-8 2 : -Duser.country=US 3 : -Duser.language=en 4 : -Duser.variant BootClassPathSupported : false
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':lib:pitest'.
Try:
Get more help at https://help.gradle.org
BUILD FAILED in 15s 11 actionable tasks: 11 executed ➜ basics git:(feature/improve-strategy-tests) ✗