From ea4a8a03a71023b789ecff2ca70779a40eba28de Mon Sep 17 00:00:00 2001 From: "Sergey.Shanshin" Date: Thu, 29 Feb 2024 18:08:43 +0100 Subject: [PATCH] Bump Kover version to `0.8.0-Beta` --- .../main/kotlin/kover-conventions.gradle.kts | 44 ++++++++++--------- gradle.properties | 2 +- kotlinx-coroutines-core/build.gradle.kts | 44 +++++++++---------- kotlinx-coroutines-debug/build.gradle.kts | 12 ++--- .../build.gradle.kts | 18 ++++---- .../build.gradle.kts | 16 ++++--- .../build.gradle.kts | 2 - 7 files changed, 73 insertions(+), 65 deletions(-) diff --git a/buildSrc/src/main/kotlin/kover-conventions.gradle.kts b/buildSrc/src/main/kotlin/kover-conventions.gradle.kts index 477d60fbb2..d87e132539 100644 --- a/buildSrc/src/main/kotlin/kover-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/kover-conventions.gradle.kts @@ -37,33 +37,37 @@ subprojects { } } - extensions.configure("koverReport") { - defaults { - html { - setReportDir(conventionProject.layout.buildDirectory.dir("kover/${project.name}/html")) - } + extensions.configure("kover") { + reports { + total { + html { + htmlDir = conventionProject.layout.buildDirectory.dir("kover/${project.name}/html") + } - verify { - rule { - /* - * 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. - */ - minBound(expectedCoverage[projectName] ?: 85) // COVERED_LINES_PERCENTAGE + verify { + rule { + /* + * 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. + */ + minBound(expectedCoverage[projectName] ?: 85) // COVERED_LINES_PERCENTAGE + } } } } } } -koverReport { - defaults { - verify { - rule { - minBound(85) // COVERED_LINES_PERCENTAGE +kover { + reports { + total { + verify { + rule { + minBound(85) // COVERED_LINES_PERCENTAGE + } } } } diff --git a/gradle.properties b/gradle.properties index 0aa26b50db..bc4bd56a0b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,7 +20,7 @@ rxjava3_version=3.0.2 javafx_version=17.0.2 javafx_plugin_version=0.0.8 binary_compatibility_validator_version=0.13.2 -kover_version=0.7.4 +kover_version=0.8.0-Beta blockhound_version=1.0.8.RELEASE jna_version=5.9.0 diff --git a/kotlinx-coroutines-core/build.gradle.kts b/kotlinx-coroutines-core/build.gradle.kts index 9efc7847c9..0c6f65cabd 100644 --- a/kotlinx-coroutines-core/build.gradle.kts +++ b/kotlinx-coroutines-core/build.gradle.kts @@ -272,31 +272,31 @@ val check by tasks.getting { } kover { - excludeTests { - // Always disabled, lincheck doesn't really support coverage - tasks("jvmLincheckTest") - } + currentProject { + instrumentation { + // Always disabled, lincheck doesn't really support coverage + disabledForTestTasks.addAll("jvmLincheckTest") - excludeInstrumentation { - // lincheck has NPE error on `ManagedStrategyStateHolder` class - classes("org.jetbrains.kotlinx.lincheck.*") + // lincheck has NPE error on `ManagedStrategyStateHolder` class + excludedClasses.addAll("org.jetbrains.kotlinx.lincheck.*") + } } -} -koverReport { - filters { - excludes { - classes( - "kotlinx.coroutines.debug.*", // Tested by debug module - "kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt*", // Deprecated - "kotlinx.coroutines.scheduling.LimitingDispatcher", // Deprecated - "kotlinx.coroutines.scheduling.ExperimentalCoroutineDispatcher", // Deprecated - "kotlinx.coroutines.flow.FlowKt__MigrationKt*", // Migrations - "kotlinx.coroutines.flow.LintKt*", // Migrations - "kotlinx.coroutines.internal.WeakMapCtorCache", // Fallback implementation that we never test - "_COROUTINE._CREATION", // For IDE navigation - "_COROUTINE._BOUNDARY", // For IDE navigation - ) + reports { + filters { + excludes { + classes( + "kotlinx.coroutines.debug.*", // Tested by debug module + "kotlinx.coroutines.channels.ChannelsKt__DeprecatedKt*", // Deprecated + "kotlinx.coroutines.scheduling.LimitingDispatcher", // Deprecated + "kotlinx.coroutines.scheduling.ExperimentalCoroutineDispatcher", // Deprecated + "kotlinx.coroutines.flow.FlowKt__MigrationKt*", // Migrations + "kotlinx.coroutines.flow.LintKt*", // Migrations + "kotlinx.coroutines.internal.WeakMapCtorCache", // Fallback implementation that we never test + "_COROUTINE._CREATION", // For IDE navigation + "_COROUTINE._BOUNDARY", // For IDE navigation + ) + } } } } diff --git a/kotlinx-coroutines-debug/build.gradle.kts b/kotlinx-coroutines-debug/build.gradle.kts index 83fc944fb9..a9b2d6730d 100644 --- a/kotlinx-coroutines-debug/build.gradle.kts +++ b/kotlinx-coroutines-debug/build.gradle.kts @@ -99,11 +99,13 @@ configurations { } } -koverReport { - filters { - excludes { - // Never used, safety mechanism - classes("kotlinx.coroutines.debug.internal.NoOpProbesKt") +kover { + reports { + filters { + excludes { + // Never used, safety mechanism + classes("kotlinx.coroutines.debug.internal.NoOpProbesKt") + } } } } diff --git a/reactive/kotlinx-coroutines-reactive/build.gradle.kts b/reactive/kotlinx-coroutines-reactive/build.gradle.kts index f49ffa0100..3e6ecccf3e 100644 --- a/reactive/kotlinx-coroutines-reactive/build.gradle.kts +++ b/reactive/kotlinx-coroutines-reactive/build.gradle.kts @@ -36,14 +36,16 @@ externalDocumentationLink( url = "https://www.reactive-streams.org/reactive-streams-$reactiveStreamsVersion-javadoc/" ) -koverReport { - filters { - excludes { - classes( - "kotlinx.coroutines.reactive.FlowKt", // Deprecated - "kotlinx.coroutines.reactive.FlowKt__MigrationKt", // Deprecated - "kotlinx.coroutines.reactive.ConvertKt" // Deprecated - ) +kover { + reports { + filters { + excludes { + classes( + "kotlinx.coroutines.reactive.FlowKt", // Deprecated + "kotlinx.coroutines.reactive.FlowKt__MigrationKt", // Deprecated + "kotlinx.coroutines.reactive.ConvertKt" // Deprecated + ) + } } } } diff --git a/reactive/kotlinx-coroutines-reactor/build.gradle.kts b/reactive/kotlinx-coroutines-reactor/build.gradle.kts index 4c056ee35d..e1bc732a07 100644 --- a/reactive/kotlinx-coroutines-reactor/build.gradle.kts +++ b/reactive/kotlinx-coroutines-reactor/build.gradle.kts @@ -32,13 +32,15 @@ externalDocumentationLink( ) -koverReport { - filters { - excludes { - classes( - "kotlinx.coroutines.reactor.FlowKt", // Deprecated - "kotlinx.coroutines.reactor.ConvertKt\$asFlux$1" // Deprecated - ) +kover { + reports { + filters { + excludes { + classes( + "kotlinx.coroutines.reactor.FlowKt", // Deprecated + "kotlinx.coroutines.reactor.ConvertKt\$asFlux$1" // Deprecated + ) + } } } } diff --git a/ui/kotlinx-coroutines-android/build.gradle.kts b/ui/kotlinx-coroutines-android/build.gradle.kts index a09d02ca75..adbafe4571 100644 --- a/ui/kotlinx-coroutines-android/build.gradle.kts +++ b/ui/kotlinx-coroutines-android/build.gradle.kts @@ -1,5 +1,3 @@ -import kotlinx.kover.api.* - configurations { create("r8") }