Я использую PIT Mutation Test для огромной программы java (более 450.000 LO C). Все это разделено на com.myProgramm.TheNormalClasses
и com.myProgramm.TheNormalClasses.Test
. Поэтому я изменяю pom.xml
в com.myProgramm.TheNormalClasses.Test
на следующее:
<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>
Тогда я удалил тег конфигурации, а затем в моем Pit Test нашел 0 тестовых классов для minion. После добавления тега конфигурации в мои классы он находит 5 тестовых классов, но не будет их использовать. Вот мой вывод:
[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
Итак, что это за сообщение об ошибке? Я не понимаю проблемы. У меня никогда не было этого раньше с другими Java программами, где тесты находятся в одном пакете, но только в разных папках: sr c и тесты
Что мне теперь делать?