diff --git a/backend/build.gradle b/backend/build.gradle index 9afc24a..eed3c05 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -1,5 +1,6 @@ plugins { id 'java' + id 'jacoco' id 'org.springframework.boot' version '4.0.6' id 'io.spring.dependency-management' version '1.1.7' } @@ -44,4 +45,39 @@ dependencies { tasks.named('test') { useJUnitPlatform() + finalizedBy jacocoTestReport +} + +jacoco { + toolVersion = "0.8.12" +} + +jacocoTestReport { + dependsOn test + reports { + xml.required = true + csv.required = false + html.required = true + } +} + +jacocoTestCoverageVerification { + dependsOn jacocoTestReport + violationRules { + rule { + limit { + minimum = 0.70 + } + } + rule { + limit { + counter = 'BRANCH' + minimum = 0.60 + } + } + } +} + +tasks.named('check').configure { + dependsOn jacocoTestCoverageVerification }