0

I use the PIT Mutation Test for a huge java programm (over 450.000 LOC). It is all seperated into com.myProgramm.TheNormalClasses and com.myProgramm.TheNormalClasses.Test. So I change my pom.xml in the com.myProgramm.TheNormalClasses.Test to this:

 <build>
    <plugins>

    <!-- START MUTATIONTEST TOOL -->
            <plugin>
        <groupId>org.pitest</groupId>
        <artifactId>pitest-maven</artifactId>
        <version>1.4.11</version>

<configuration>
        <targetClasses>
       <param>com.myProgramm.TheNormalClasses.*</param>
    </targetClasses>
    <targetTests>
        <param>ccom.myProgramm.TheNormalClasses.*</param>
         </targetTests>

    </configuration>

        <executions>
            <execution>
                <id>pit-report</id>
                <goals>
                    <goal>mutationCoverage</goal>
                </goals>
            </execution>
        </executions>
            </plugin>
            <!-- END MUTATIONTEST TOOL -->

            </plugins>
            </build>

Back then I removed the configuration-tag then my Pit Test find 0 test classes to minion. After adding the configuration-tag to my classes it find 5 test classes, but won't use them. Here is my output:

    [INFO] --- pitest-maven:1.4.11:mutationCoverage (pit-report) @ com.myProgramm.TheNormalClasses.Test ---
[INFO] Found plugin : Default csv report plugin
[INFO] Found plugin : Default xml report plugin
[INFO] Found plugin : Default html report plugin
[INFO] Found plugin : Static initializer code detector plugin
[INFO] Found plugin : Static initializer filter plugin
[INFO] Found plugin : Excluded annotations plugin
[INFO] Found plugin : Try with resources filter
[INFO] Found plugin : Inlined finally block filter plugin
[INFO] Found plugin : Implicit null check filter
[INFO] Found plugin : Method reference null check filter
[INFO] Found plugin : For each loop filter
[INFO] Found plugin : Logging calls filter
[INFO] Found plugin : Infinite for loop filter
[INFO] Found plugin : Long running iterator loop filter
[INFO] Found plugin : For loop counter filter
[INFO] Found plugin : Kotlin junk mutations filter
[INFO] Found plugin : Max mutations per class limit
[INFO] Found plugin : Equals shortcut equivalent mutant filter
[INFO] Found plugin : Trivial return vals equivalence filter
[INFO] Found plugin : Mutant export plugin
[INFO] Found shared classpath plugin : Default mutation engine
[INFO] Found shared classpath plugin : JUnit plugin
[INFO] Found shared classpath plugin : TestNG plugin
[INFO] Adding org.pitest:pitest to SUT classpath
[INFO] Mutating from C:\MyProgram\com.myProgramm.TheNormalClasses.Test\target\classes
19:55:00 PIT >> INFO : Verbose logging is disabled. If you encounter a problem, please enable it before reporting an issue.
19:55:01 PIT >> INFO : Sending 1 test classes to minion
19:55:01 PIT >> INFO : Sent tests to minion
19:55:01 PIT >> INFO : MINION : 19:55:01 PIT >> INFO : Checking environment

19:55:01 PIT >> INFO : MINION : 19:55:01 PIT >> INFO : Found  5 tests

19:55:01 PIT >> INFO : MINION : 19:55:01 PIT >> INFO : Dependency analysis reduced number of potential tests by 0

19:55:01 PIT >> INFO : MINION : 19:55:01 PIT >> INFO : 5 tests received

/19:55:02 PIT >> INFO : Calculated coverage in 1 seconds.
19:55:02 PIT >> INFO : Created  0 mutation test units
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.475 s
[INFO] Finished at: 2020-03-29T19:55:02+02:00
[INFO] Final Memory: 56M/639M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.pitest:pitest-maven:1.4.11:mutationCoverage (pit-report) on project com.myProgramm.TheNormalClasses.Test: Execution pit-report of goal org.pitest:pitest-maven:1.4.11:mutationCoverage failed: No mutations found. This probably means there is an issue with either the supplied classpath or filters.
[ERROR] See http://pitest.org for more details.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

So, what is this error message? I don't understand the problem. I never had this before with other Java programms, where the tests are in the same package, but only in different folgers: src and tests

What should I do now?

Eklavya
  • 17,618
  • 4
  • 28
  • 57
J K Fan
  • 1
  • 2
  • Based on what you've posted the most likely issue is that the glob you have supplied for targetClasses is not correct and does not match any of the compiled classes. You don't look to have bound the plugin to a maven phase, so another possibility is that the code is not compiled (although this is unlikely since it is finding tests). – henry Mar 30 '20 at 13:24
  • for efficiency reasons, PIT tries to map your test classes to code classes. this is important to know which tests to run for each mutation. `19:55:01 PIT >> INFO : MINION : 19:55:01 PIT >> INFO : Dependency analysis reduced number of potential tests by 0` -> this makes me thing that PIT is not mapping things correctly...I suppose your code is not public? – pedrorijo91 Mar 31 '20 at 07:53
  • Thank you for some help! In Eclipse is this Mutationtest working fine. But in the CLI not. So now I am really confused. I checked the propertoes in Eclipse, how PIT ist starting. I have the same in my pom. I use also OSGi. Maybe this info is important? – J K Fan Apr 01 '20 at 15:16

0 Answers0