Skip to content

Commit

Permalink
Merge pull request #101 from tukcomCD2024/chore#100/set-jacoco
Browse files Browse the repository at this point in the history
[#100] Jacoco gradle 설정 완료
  • Loading branch information
JunRain2 authored Jun 7, 2024
2 parents bac08cf + 3b8c591 commit 4298ef0
Showing 1 changed file with 63 additions and 2 deletions.
65 changes: 63 additions & 2 deletions backend/memetory/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id 'org.springframework.boot' version '3.2.2'
id 'io.spring.dependency-management' version '1.1.4'
id 'com.google.cloud.tools.jib' version '3.4.1'
id 'jacoco'
}

group = 'com.example'
Expand Down Expand Up @@ -70,8 +71,67 @@ clean {
delete file('src/main/generated')
}

tasks.named('test') {
test {
useJUnitPlatform()
finalizedBy 'jacocoTestReport'
}

jacocoTestReport {
reports {
xml.required.set(false)
csv.required.set(true)
html.required.set(true)
}
def Qdomains = []

for (qPattern in '**/QA'..'**/QZ') {
Qdomains.add(qPattern + '*')
}

afterEvaluate {
classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(dir: it,
excludes: ["**/dto/**",
"**/exception/**",
"**/userInfo/**",
"com/example/memetory/MemetoryApplication.class"
] + Qdomains)
})

)
}

finalizedBy 'jacocoTestCoverageVerification'
}

jacocoTestCoverageVerification {
def Qdomains = []

for (qPattern in '*.QA'..'*.QZ') {
Qdomains.add(qPattern + '*')
}


violationRules {
rule {
enabled = true
element = 'CLASS'

limit {
counter = 'METHOD'
value = 'COVEREDRATIO'
minimum = 0.00
}

limit {
counter = 'INSTRUCTION'
value = 'COVEREDRATIO'
minimum = 0.00
}
excludes = [] + Qdomains
}
}
}

jib {
Expand All @@ -90,4 +150,5 @@ jib {
container {
jvmFlags = ['-Dspring.profiles.active=dev']
}
}
}

0 comments on commit 4298ef0

Please sign in to comment.