Skip to content

Update Kover to 0.6.0-Beta #3386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 31 additions & 30 deletions buildSrc/src/main/kotlin/kover-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import kotlinx.kover.tasks.*
/*
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
apply(plugin = "kover")

val notCovered = sourceless + internal + unpublished

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

// Reactor has lower coverage in general due to various fatal error handling features
"kotlinx-coroutines-reactor" to 75)

extensions.configure<KoverExtension> {
disabledProjects = notCovered
/*
* Is explicitly enabled on TC in a separate build step.
* Examples:
* ./gradlew :p:check -- doesn't verify coverage
* ./gradlew :p:check -Pkover.enabled=true -- verifies coverage
* ./gradlew :p:koverReport -Pkover.enabled=true -- generates report
*/
isDisabled = !(properties["kover.enabled"]?.toString()?.toBoolean() ?: false)
// TODO remove when updating Kover to version 0.5.x
intellijEngineVersion.set("1.0.657")
}
"kotlinx-coroutines-reactor" to 75
)



subprojects {
val projectName = name
if (projectName in notCovered) return@subprojects
tasks.withType<KoverVerificationTask> {
rule {
bound {
/*
* 85 is our baseline that we aim to raise to 90+.
* Missing coverage is typically due to bugs in the agent
* (e.g. signatures deprecated with an error are counted),
* sometimes it's various diagnostic `toString` or `catch` for OOMs/VerificationErrors,
* but some places are definitely worth visiting.
*/
minValue = expectedCoverage[projectName] ?: 85 // COVERED_LINES_PERCENTAGE
apply(plugin = "kover")

extensions.configure<KoverProjectConfig> {
/*
* Is explicitly enabled on TC in a separate build step.
* Examples:
* ./gradlew :p:check -- doesn't verify coverage
* ./gradlew :p:check -Pkover.enabled=true -- verifies coverage
* ./gradlew :p:koverReport -Pkover.enabled=true -- generates report
*/
isDisabled.set(!(properties["kover.enabled"]?.toString()?.toBoolean() ?: false))

verify {
rule {
bound {
/*
* 85 is our baseline that we aim to raise to 90+.
* Missing coverage is typically due to bugs in the agent
* (e.g. signatures deprecated with an error are counted),
* sometimes it's various diagnostic `toString` or `catch` for OOMs/VerificationErrors,
* but some places are definitely worth visiting.
*/
minValue = expectedCoverage[projectName] ?: 85 // COVERED_LINES_PERCENTAGE
}
}
}
}

tasks.withType<KoverHtmlReportTask> {
htmlReportDir.set(file(rootProject.buildDir.toString() + "/kover/" + project.name + "/html"))
htmlReport {
reportDir.set(file(rootProject.buildDir.toString() + "/kover/" + project.name + "/html"))
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ rxjava3_version=3.0.2
javafx_version=11.0.2
javafx_plugin_version=0.0.8
binary_compatibility_validator_version=0.11.0
kover_version=0.5.0
kover_version=0.6.0-Beta
blockhound_version=1.0.2.RELEASE
jna_version=5.9.0

Expand Down
12 changes: 6 additions & 6 deletions reactive/kotlinx-coroutines-reactive/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ val commonKoverExcludes = listOf(
"kotlinx.coroutines.reactive.ConvertKt" // Deprecated
)

tasks.koverHtmlReport {
excludes = commonKoverExcludes
}

tasks.koverVerify {
excludes = commonKoverExcludes
kover {
filters {
classes {
excludes += commonKoverExcludes
}
}
}
12 changes: 6 additions & 6 deletions reactive/kotlinx-coroutines-reactor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ val commonKoverExcludes = listOf(
"kotlinx.coroutines.reactor.ConvertKt\$asFlux$1" // Deprecated
)

tasks.koverHtmlReport {
excludes = commonKoverExcludes
}

tasks.koverVerify {
excludes = commonKoverExcludes
kover {
filters {
classes {
excludes += commonKoverExcludes
}
}
}
2 changes: 1 addition & 1 deletion ui/kotlinx-coroutines-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,6 @@ open class RunR8 : JavaExec() {

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