我试图从命令行运行maven构建,并将PITest排除在运行任何突变之外。当前,报告正在失败,我们需要提供一个参数来忽略运行变异测试或忽略结果并继续构建。
我运行了一些参数,如mvn package -Dpit.report=true
或mvn package -Dmaven.report.skip=true
这是我的pom中的PITest设置
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.1.10</version>
<configuration>
<timestampedReports>false</timestampedReports>
<mutationThreshold>95</mutationThreshold>
</configuration>
<executions>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>mutationCoverage</goal>
</goals>
</execution>
</executions>
</plugin>
问题是仍然在运行PITest并导致构建失败。
发布于 2019-09-26 08:11:09
没有跳过插件执行的原生方法,但至少有两个解决方案:
将具有默认值的属性pitPhase
定义为插件执行的默认阶段。
然后在插件配置中:
<execution>
<phase>${pitPhase}</phase>
...
</execution>
之后,当您想要跳过执行时,mvn -DskipPit=pitPhase package
发布于 2021-10-07 04:30:21
从1.4.11开始,就有了选项skipPitest
。见此处:https://github.com/hcoles/pitest/releases/tag/pitest-parent-1.4.11
你就是这么做的:-DskipPitest
发布于 2021-03-12 03:28:04
在Maven中可以跳过皮特的执行。
在pom.xml中:
<properties>
<pitest.execution.skip>true</pitest.execution.skip>
</properties>
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>Your_Version</version>
<configuration>
<skip>${pitest.execution.skip}</skip>
</configuration>
</plugin>
https://stackoverflow.com/questions/58120665
复制