Skip to content

When subprojects have missing reports, aggregation fails #292

@ghost

Description

Assuming a gradle project where some subprojects

  • have the pitest plugin disable; or
  • have failWhenNoMutations set

We will have some subprojects with to files to aggregate.

When attempting to run pitestReport on such a project then the following error is shown

Execution failed for task ':pitestReportAggregate'.
> A failure occurred while executing info.solidsoft.gradle.pitest.AggregateReportGenerator
   > /... snip .../build/reports/pitest/linecoverage.xml does not exist or is not a file

This is due to the check in ReportAggregator.Builder when a file is added to aggregation it must exist.

Whilst it is fairly easily to "hack" AggregateReportTask to strip out subprojects for which pitest is disabled, the failWhenNoMutations issue is trickier as this needs to be checked at task execution time.

So AggregateReportTask needs to determine whether reports are missing for a particular subproject and whether that should be an error or not.

Proposal

  • remove subprojects for which the pitest task is disabled from aggregation altogether
  • when building the report config, if a pitest task has failWhenNoMutations, allow the files to be missing and do not add them to be report aggregator.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions