0

我正在尝试使用 ptest 在 Apache Airavata (v0.16) 上应用突变测试。我在 build plugins 标签下的 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>
4

1 回答 1

0

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

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

于 2017-03-30T15:04:05.670 回答