2

I am using gradle wrapper to run my pitest. I have parent build.gradle which has the pitest defined. My subprojects does not have any pitest. If I run the pitest on individual project for example gradlew clean :myproject:pitest. Then the pitest is successful. But if I try to run pitest from parent using gradlew clean pitest. Then it failes with the below error

> Task :pitest
4:57:34 PM PIT >> INFO : Verbose logging is disabled. If you encounter an 
problem please enable it before reporting an issue.
4:57:35 PM PIT >> INFO : Sending 0 test classes to minion
4:57:35 PM PIT >> INFO : Sent tests to minion
4:57:35 PM PIT >> SEVERE : Error generating coverage. Please check that your 
classpath contains JUnit 4.6 or above.
Exception in thread "main" org.pitest.util.PitError: Coverage generation 
minion exited abnormally. Please check the classpath.

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.152-b16
Uptime : 2390
Input ->
 1 : -Dfile.encoding=windows-1252
 2 : -Duser.country=US
 3 : -Duser.language=en
 4 : -Duser.variant
BootClassPathSupported : true


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.152-b16
Uptime : 2391
Input ->
 1 : -Dfile.encoding=windows-1252
 2 : -Duser.country=US
 3 : -Duser.language=en
 4 : -Duser.variant
BootClassPathSupported : true

    at 
org.pitest.util.Unchecked.translateCheckedException(Unchecked.java:20)
    at 

org.pitest.coverage.execute.DefaultCoverageGenerator.calculateCoverage(DefaultCoverageGenerator.java:103) at

org.pitest.coverage.execute.DefaultCoverageGenerator.calculateCoverage(DefaultCoverageGenerator.java:49) at

org.pitest.mutationtest.tooling.MutationCoverage.runReport(MutationCoverage.java:115) at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:116) at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:49) at

org.pitest.mutationtest.commandline.MutationCoverageReport.runReport(MutationCoverageReport.java:87) at

org.pitest.mutationtest.commandline.MutationCoverageReport.main(MutationCoverageReport.java:45) Caused by: org.pitest.util.PitError: Coverage generation minion exited abnormally. Please check the classpath.

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.152-b16
Uptime : 2390
Input ->
 1 : -Dfile.encoding=windows-1252
 2 : -Duser.country=US
 3 : -Duser.language=en
 4 : -Duser.variant
BootClassPathSupported : true

    at 

org.pitest.coverage.execute.DefaultCoverageGenerator.gatherCoverageData(DefaultCoverageGenerator.java:137) at

org.pitest.coverage.execute.DefaultCoverageGenerator.calculateCoverage(DefaultCoverageGenerator.java:87)

Can any one direct what may be going wrong as I am using JUNIT 4.12 which is greater than 4.6 which is mentioned in the error.

Kedar
  • 21
  • 1

1 Answers1

0

In my experience, adding explicit dependency to Junit is needed although there are no tests in the submodule.

For me this fixed the problem:

<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.11</version>
    <scope>test</scope>
</dependency>
Ducaz035
  • 3,054
  • 2
  • 25
  • 45