Skip to content

Commit

Permalink
Merge pull request #203 from swm-standard/seyeon/swm-169
Browse files Browse the repository at this point in the history
Fix: jacoco test Report ๋ถˆํ•„์š” ํด๋ž˜์Šค ์ œ์™ธ
  • Loading branch information
adorableco authored Sep 4, 2024
2 parents b1e6687 + 5b6e932 commit 29cb88c
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/develop-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: chmod +x gradlew

- name: Test with Gradle
run: ./gradlew clean build test jacocoTestReport
run: ./gradlew clean build test

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
Expand Down
67 changes: 66 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
id("jacoco")

// for querydsl
kotlin("kapt") version "1.7.10"
kotlin("kapt") version "1.9.24"
}

subprojects {
Expand Down Expand Up @@ -90,6 +90,7 @@ kotlin {

tasks.withType<Test> {
useJUnitPlatform()
finalizedBy("jacocoTestReport")
}

tasks.test {
Expand Down Expand Up @@ -153,4 +154,68 @@ tasks.jacocoTestReport {
html.outputLocation = file(project.layout.buildDirectory.dir("jacoco/index.html"))
xml.outputLocation = file(project.layout.buildDirectory.dir("jacoco/index.xml"))
}

val qDomains = emptyList<String>().toMutableList()

for (c in 'A'..'Z') {
val qPattern = "**/*Q$c*"
qDomains.add("$qPattern*")
}

val excludes =
listOf(
"**/service/*",
"**/dto/*",
"**/controller/*",
"**/external/*",
"**/repository/*",
"**/common/*",
"**/*PhoteApplication*",
) + qDomains

classDirectories.setFrom(
sourceSets["main"].output.asFileTree.matching {
exclude(excludes)
},
)
finalizedBy("jacocoTestCoverageVerification")
}

tasks.jacocoTestCoverageVerification {

violationRules {
rule {
element = "CLASS"

limit {
counter = "BRANCH"
value = "COVEREDRATIO"
minimum = 0.00.toBigDecimal()
}

limit {
counter = "METHOD"
value = "COVEREDRATIO"
minimum = 0.00.toBigDecimal()
}

val qDomains = emptyList<String>().toMutableList()

for (c in 'A'..'Z') {
val qPattern = "**.*Q$c*"
qDomains.add("$qPattern*")
}

excludes =
listOf(
"**.service.*",
"**.dto.*",
"**.controller.*",
"**.external.*",
"**.repository.*",
"**.common.*",
"**.*PhoteApplication*",
) + qDomains
}
}
}

0 comments on commit 29cb88c

Please sign in to comment.