pitest
pitest copied to clipboard
Skipping report-aggregate does not work
I am aggregating reports by using report-aggregate
goal of pitest-1.6.8
.
By default, I don't want to run the aggregation. So I defined a property which value is true in order to change it by mvn -D
parameter and passing the property value using a variable to the configuration named 'skip' of pitest-maven.
I'm expecting that the report-aggregate will not run while not passing the corresponding -D
parameter to mvn
. But it fails. The report-aggregate
is still running.
By reading the source code, I found that AbstractPitAggregationReportMojo
ignores the skip
property of PitReportMojo
totally. Can we just check skip
property in org.pitest.maven.report.AbstractPitAggregationReportMojo#executeReport
function in order to use the skip
configuration to skip the report-aggregate
goal?
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<properties>
<pitest.skip>true</pitest.skip>
</properties>
<!-- other things such as parent and dependencies ... -->
<build>
<plugins>
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.6.8</version>
<configuration>
<failWhenNoMutations>false</failWhenNoMutations>
<exportLineCoverage>true</exportLineCoverage>
<outputFormats><outputFormat>XML</outputFormat><outputFormat>HTML</outputFormat></outputFormats>
<timestampedReports>false</timestampedReports>
<skip>${pitest.skip}</skip> <!-- Expecting skip report-aggregate goal -->
</configuration>
<executions>
<execution>
<id>report</id>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Happy to accept a pull request. I never use the aggregation myself, so it doesn't receive much attention.
I would also love the feature to skip aggragate, when piTest skip, because this is breaking the build.