Skip to content

Commit 3dfee68

Browse files
committed
Apply codecov
1 parent 54456ac commit 3dfee68

File tree

4 files changed

+56
-3
lines changed

4 files changed

+56
-3
lines changed

.codecov.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# https://docs.codecov.com/docs/pull-request-comments
2+
comment:
3+
layout: "diff, flags, files"
4+
behavior: default
5+
require_changes: false
6+
require_base: false
7+
require_head: true
8+
hide_project_coverage: false

.github/workflows/pull_request_event.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ jobs:
2626
distribution: 'temurin'
2727
java-version: 17
2828
- name: Test
29-
run: ./gradlew clean test --info
29+
run: ./gradlew clean test jacocoAggregateReport --info
30+
- name: Upload the coverage report to Codecov
31+
uses: codecov/codecov-action@v5
32+
env:
33+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

build.gradle.kts

+42-1
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ allprojects {
5757
finalizedBy(tasks.jacocoTestReport)
5858
}
5959

60-
tasks.withType<JacocoReport> {
60+
tasks.named<JacocoReport>("jacocoTestReport") {
6161
reports {
6262
xml.required.set(true)
63+
html.required.set(true)
6364
}
6465
}
6566

@@ -152,3 +153,43 @@ subprojects {
152153
}
153154
}
154155
}
156+
157+
tasks.register<JacocoReport>("jacocoAggregateReport") {
158+
dependsOn(subprojects.map { it.tasks.named("test") })
159+
160+
additionalSourceDirs.setFrom(
161+
files(
162+
subprojects.map {
163+
it.sourceSets.main.get().allSource.srcDirs
164+
},
165+
),
166+
)
167+
sourceDirectories.setFrom(
168+
files(
169+
subprojects.map {
170+
it.sourceSets.main.get().allSource.srcDirs
171+
},
172+
),
173+
)
174+
classDirectories.setFrom(
175+
files(
176+
subprojects.map {
177+
it.sourceSets.main.get().output
178+
},
179+
),
180+
)
181+
executionData.setFrom(
182+
files(
183+
subprojects.map {
184+
it.buildDir.resolve("jacoco/test.exec")
185+
},
186+
),
187+
)
188+
189+
reports {
190+
xml.required.set(true)
191+
xml.outputLocation.set(file("$buildDir/reports/jacoco/test/jacocoTestReport.xml"))
192+
html.required.set(true)
193+
html.outputLocation.set(file("$buildDir/reports/jacoco/test/html"))
194+
}
195+
}

core-kotlin-coroutine/src/main/kotlin/com/linecorp/cse/reqshield/kotlin/coroutine/KeyLocalLock.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class KeyLocalLock(private val lockTimeoutMillis: Long) : KeyLock, CoroutineScop
4545
while (isActive) {
4646
runCatching {
4747
val now = System.currentTimeMillis()
48-
lockMap.entries.removeIf { now - it.value.createdAt > lockTimeoutMillis } // 특정 시간이 지나면 lock 여부와 상관없이 map에서 삭제한다.
48+
lockMap.entries.removeIf { now - it.value.createdAt > lockTimeoutMillis }
4949
delay(LOCK_MONITOR_INTERVAL_MILLIS)
5050
}.onFailure { e ->
5151
log.error("Error in lock lifecycle monitoring : {}", e.message)

0 commit comments

Comments
 (0)