pitest - PIT 需要 JUnit 4(但可以 运行 JUnit 3 测试)或 TestNG

pitest - PIT requires either JUnit 4 (but can run JUnit 3 tests) or TestNG

我正在尝试使用 pitest 在 Apache Airavata (v0.16) 上应用突变测试。我将以下行添加到构建插件标签下的 pom.xml 文件中:

<plugin>
    <groupId>org.pitest</groupId>
    <artifactId>pitest-maven</artifactId>
    <version>1.1.11</version>
 </plugin>

它给我以下错误。

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.012 s
[INFO] Finished at: 2017-03-30T14:27:44+03:00
[INFO] Final Memory: 21M/212M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.pitest:pitest-maven:1.1.11:mutationCoverage (default-cli) on project airavata-server-configuration: Execution default-cli of goal org.pitest:pitest-maven:1.1.11:mutationCoverage failed: No test library found on classpath. PIT requires either JUnit 4 (but can run JUnit 3 tests) or TestNG
[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
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :airavata-server-configuration

我没有 TestNG 但 junit4 路径包含在 CLASSPATH 中。我尝试提供一些有针对性的测试用例如下,但它也没有用。

<plugin>
    <groupId>org.pitest</groupId>
    <artifactId>pitest-maven</artifactId>
    <version>1.1.11</version>
    <configuration>
        <targetTests>
            <param>org.apache.archiva.common.utils*</param>
        </targetTests> 
    </configuration>
</plugin>

我也试过以下标签,但一点用都没有。

<failWhenNoMutations>false</failWhenNoMutations>

Archiva 似乎包含许多不包含源代码或测试的模块。

pitest 的 1.1.12 版本将自动跳过这些(参见 314),但在该版本发布之前,您需要在每个不包含的模块中设置跳过 属性测试。