Skipping report-aggregate does not work

Open Beginner friendly
#920 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
java

Research direction

Start at org.pitest.maven.report.AbstractPitAggregationReportMojo#executeReport and inspect how the skip property is handled compared with PitReportMojo. Done means the report-aggregate goal does not run when the configured skip value is true, while still running when it is false.

Written by the indexing model from the issue text.

Description

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>
Dominant language
Java
Stars
1.9k
Forks
373
Avg merge
3h 49m
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hcoles/pitest

All issues in hcoles/pitest

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.