Skip to content

Commit

Permalink
Apply codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
chany714 committed Jan 3, 2025
1 parent 37922dc commit d959795
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# https://docs.codecov.com/docs/pull-request-comments
comment:
layout: "diff, flags, files"
behavior: default
require_changes: false
require_base: false
require_head: true
hide_project_coverage: false
6 changes: 5 additions & 1 deletion .github/workflows/pull_request_event.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ jobs:
distribution: 'temurin'
java-version: 17
- name: Test
run: ./gradlew clean test --info
run: ./gradlew clean test jacocoAggregateReport --info
- name: Upload the coverage report to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
43 changes: 42 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ allprojects {
finalizedBy(tasks.jacocoTestReport)
}

tasks.withType<JacocoReport> {
tasks.named<JacocoReport>("jacocoTestReport") {
reports {
xml.required.set(true)
html.required.set(true)
}
}

Expand Down Expand Up @@ -152,3 +153,43 @@ subprojects {
}
}
}

tasks.register<JacocoReport>("jacocoAggregateReport") {
dependsOn(subprojects.map { it.tasks.named("test") })

additionalSourceDirs.setFrom(
files(
subprojects.map {
it.sourceSets.main.get().allSource.srcDirs

Check failure on line 163 in build.gradle.kts

View workflow job for this annotation

GitHub Actions / Check Code Quality

[ktlint] reported by reviewdog 🐶 Expected newline before '.' Raw Output: build.gradle.kts:163:35: error: Expected newline before '.' (standard:chain-method-continuation)

Check failure on line 163 in build.gradle.kts

View workflow job for this annotation

GitHub Actions / Check Code Quality

[ktlint] reported by reviewdog 🐶 Expected newline before '.' Raw Output: build.gradle.kts:163:41: error: Expected newline before '.' (standard:chain-method-continuation)
},
),
)
sourceDirectories.setFrom(
files(
subprojects.map {
it.sourceSets.main.get().allSource.srcDirs

Check failure on line 170 in build.gradle.kts

View workflow job for this annotation

GitHub Actions / Check Code Quality

[ktlint] reported by reviewdog 🐶 Expected newline before '.' Raw Output: build.gradle.kts:170:35: error: Expected newline before '.' (standard:chain-method-continuation)

Check failure on line 170 in build.gradle.kts

View workflow job for this annotation

GitHub Actions / Check Code Quality

[ktlint] reported by reviewdog 🐶 Expected newline before '.' Raw Output: build.gradle.kts:170:41: error: Expected newline before '.' (standard:chain-method-continuation)
},
),
)
classDirectories.setFrom(
files(
subprojects.map {
it.sourceSets.main.get().output

Check failure on line 177 in build.gradle.kts

View workflow job for this annotation

GitHub Actions / Check Code Quality

[ktlint] reported by reviewdog 🐶 Expected newline before '.' Raw Output: build.gradle.kts:177:35: error: Expected newline before '.' (standard:chain-method-continuation)

Check failure on line 177 in build.gradle.kts

View workflow job for this annotation

GitHub Actions / Check Code Quality

[ktlint] reported by reviewdog 🐶 Expected newline before '.' Raw Output: build.gradle.kts:177:41: error: Expected newline before '.' (standard:chain-method-continuation)
},
),
)
executionData.setFrom(
files(
subprojects.map {
it.buildDir.resolve("jacoco/test.exec")
},
),
)

reports {
xml.required.set(true)
xml.outputLocation.set(file("$buildDir/reports/jacoco/test/jacocoTestReport.xml"))
html.required.set(true)
html.outputLocation.set(file("$buildDir/reports/jacoco/test/html"))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class KeyLocalLock(private val lockTimeoutMillis: Long) : KeyLock, CoroutineScop
while (isActive) {
runCatching {
val now = System.currentTimeMillis()
lockMap.entries.removeIf { now - it.value.createdAt > lockTimeoutMillis } // 특정 시간이 지나면 lock 여부와 상관없이 map에서 삭제한다.
lockMap.entries.removeIf { now - it.value.createdAt > lockTimeoutMillis }
delay(LOCK_MONITOR_INTERVAL_MILLIS)
}.onFailure { e ->
log.error("Error in lock lifecycle monitoring : {}", e.message)
Expand Down

0 comments on commit d959795

Please sign in to comment.