Skip to content

Commit 79e32f7

Browse files
qwwdfsadPavelPunegov
authored andcommitted
Update Kover to 0.6.0-Beta (#3386)
1 parent 48e46f1 commit 79e32f7

File tree

4 files changed

+44
-43
lines changed

4 files changed

+44
-43
lines changed

buildSrc/src/main/kotlin/kover-conventions.gradle.kts

+31-30
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import kotlinx.kover.tasks.*
44
/*
55
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
66
*/
7-
apply(plugin = "kover")
87

98
val notCovered = sourceless + internal + unpublished
109

@@ -14,41 +13,43 @@ val expectedCoverage = mutableMapOf(
1413
"kotlinx-coroutines-javafx" to 39, // JavaFx is not tested on TC because its graphic subsystem cannot be initialized in headless mode
1514

1615
// Reactor has lower coverage in general due to various fatal error handling features
17-
"kotlinx-coroutines-reactor" to 75)
18-
19-
extensions.configure<KoverExtension> {
20-
disabledProjects = notCovered
21-
/*
22-
* Is explicitly enabled on TC in a separate build step.
23-
* Examples:
24-
* ./gradlew :p:check -- doesn't verify coverage
25-
* ./gradlew :p:check -Pkover.enabled=true -- verifies coverage
26-
* ./gradlew :p:koverReport -Pkover.enabled=true -- generates report
27-
*/
28-
isDisabled = !(properties["kover.enabled"]?.toString()?.toBoolean() ?: false)
29-
// TODO remove when updating Kover to version 0.5.x
30-
intellijEngineVersion.set("1.0.657")
31-
}
16+
"kotlinx-coroutines-reactor" to 75
17+
)
18+
19+
3220

3321
subprojects {
3422
val projectName = name
3523
if (projectName in notCovered) return@subprojects
36-
tasks.withType<KoverVerificationTask> {
37-
rule {
38-
bound {
39-
/*
40-
* 85 is our baseline that we aim to raise to 90+.
41-
* Missing coverage is typically due to bugs in the agent
42-
* (e.g. signatures deprecated with an error are counted),
43-
* sometimes it's various diagnostic `toString` or `catch` for OOMs/VerificationErrors,
44-
* but some places are definitely worth visiting.
45-
*/
46-
minValue = expectedCoverage[projectName] ?: 85 // COVERED_LINES_PERCENTAGE
24+
apply(plugin = "kover")
25+
26+
extensions.configure<KoverProjectConfig> {
27+
/*
28+
* Is explicitly enabled on TC in a separate build step.
29+
* Examples:
30+
* ./gradlew :p:check -- doesn't verify coverage
31+
* ./gradlew :p:check -Pkover.enabled=true -- verifies coverage
32+
* ./gradlew :p:koverReport -Pkover.enabled=true -- generates report
33+
*/
34+
isDisabled.set(!(properties["kover.enabled"]?.toString()?.toBoolean() ?: false))
35+
36+
verify {
37+
rule {
38+
bound {
39+
/*
40+
* 85 is our baseline that we aim to raise to 90+.
41+
* Missing coverage is typically due to bugs in the agent
42+
* (e.g. signatures deprecated with an error are counted),
43+
* sometimes it's various diagnostic `toString` or `catch` for OOMs/VerificationErrors,
44+
* but some places are definitely worth visiting.
45+
*/
46+
minValue = expectedCoverage[projectName] ?: 85 // COVERED_LINES_PERCENTAGE
47+
}
4748
}
4849
}
49-
}
5050

51-
tasks.withType<KoverHtmlReportTask> {
52-
htmlReportDir.set(file(rootProject.buildDir.toString() + "/kover/" + project.name + "/html"))
51+
htmlReport {
52+
reportDir.set(file(rootProject.buildDir.toString() + "/kover/" + project.name + "/html"))
53+
}
5354
}
5455
}

reactive/kotlinx-coroutines-reactive/build.gradle.kts

+6-6
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ val commonKoverExcludes = listOf(
4141
"kotlinx.coroutines.reactive.ConvertKt" // Deprecated
4242
)
4343

44-
tasks.koverHtmlReport {
45-
excludes = commonKoverExcludes
46-
}
47-
48-
tasks.koverVerify {
49-
excludes = commonKoverExcludes
44+
kover {
45+
filters {
46+
classes {
47+
excludes += commonKoverExcludes
48+
}
49+
}
5050
}

reactive/kotlinx-coroutines-reactor/build.gradle.kts

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ val commonKoverExcludes = listOf(
3333
"kotlinx.coroutines.reactor.ConvertKt\$asFlux$1" // Deprecated
3434
)
3535

36-
tasks.koverHtmlReport {
37-
excludes = commonKoverExcludes
38-
}
39-
40-
tasks.koverVerify {
41-
excludes = commonKoverExcludes
36+
kover {
37+
filters {
38+
classes {
39+
excludes += commonKoverExcludes
40+
}
41+
}
4242
}

ui/kotlinx-coroutines-android/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,6 @@ open class RunR8 : JavaExec() {
115115

116116
tasks.withType<Test> {
117117
extensions.configure<KoverTaskExtension> {
118-
excludes = excludes + listOf("com.android.*", "android.*") // Exclude robolectric-generated classes
118+
excludes.addAll(listOf("com.android.*", "android.*")) // Exclude robolectric-generated classes
119119
}
120120
}

0 commit comments

Comments
 (0)