Skip to content

Commit

Permalink
fix to not run root "jacocoTestCoverageVerification"
Browse files Browse the repository at this point in the history
  • Loading branch information
ole-ve committed Feb 9, 2025
1 parent 400f3a6 commit 5acff9d
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions gradle/jacoco.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,11 @@ jacocoTestReport {
}

jacocoTestCoverageVerification {
// Only run full coverage when no specific/all modules set
enabled = reportedModules.size() == 0 || reportedModules.size() == (ModuleCoverageThresholds.size() + 1) // +1 for aggregated
// Handled by each task itself
enabled = false

classDirectories.setFrom(
files(classDirectories.files.collect { classDir ->
project.fileTree(classDir) {
excludes=ignoredDirectories
}
})
)

def minInstructionCoveredRatio = AggregatedCoverageThresholds["INSTRUCTION"] as double
def maxNumberUncoveredClasses = AggregatedCoverageThresholds["CLASS"] as int
applyVerificationRule(jacocoTestCoverageVerification, minInstructionCoveredRatio, maxNumberUncoveredClasses)

if (enabled) {
def verifyCoverage = reportedModules.size() == 0 || reportedModules.size() == (ModuleCoverageThresholds.size() + 1) // +1 for aggregated
if (verifyCoverage) {
def sortedTasks = reportedModules
.sort()
.collect { module -> registerJacocoTestCoverageVerification(module as String, jacocoTestCoverageVerification) }
Expand Down

0 comments on commit 5acff9d

Please sign in to comment.