-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When subprojects have missing reports, aggregation fails #292
Comments
Can the aggregator task can be changed to depend on Pitest tasks, not projects with the Pitest plugin? I think that's what's tripping the agggregation up. I think the Gradle-ey way of doing this would to put the file-gathering work that is currently in The Pitest task can be altered to explicitly output the required files ( I'm not sure that the worker queue is required. |
A workaround for this failure is to apply the Pitest plugin and settings only to the subprojects that will be tested. I created an internal method to make it clearer and easier to understand. This solution worked for me because the method The solution: plugins {
id 'info.solidsoft.pitest' version '1.9.11' apply false
}
apply plugin: 'info.solidsoft.pitest.aggregator'
subprojects {
apply plugin: 'java'
if (shouldApplyPitestPlugin(project.name)) {
apply plugin: 'info.solidsoft.pitest'
pitest {
junit5PluginVersion = '1.0.0'
useClasspathFile = true
outputFormats = [ "XML", "HTML" ]
exportLineCoverage = true
timestampedReports = false
}
}
}
static def shouldApplyPitestPlugin(projectName) {
def subProjectsToIgnorePitestPlugin = [
'module-without-any-test-1', 'module-without-any-test-2'
]
return !(projectName in subProjectsToIgnorePitestPlugin)
} |
Assuming a gradle project where some subprojects
failWhenNoMutations
setWe will have some subprojects with to files to aggregate.
When attempting to run
pitestReport
on such a project then the following error is shownThis 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, thefailWhenNoMutations
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
failWhenNoMutations
, allow the files to be missing and do not add them to be report aggregator.The text was updated successfully, but these errors were encountered: