-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented verification in Kover Aggregated Plugin
Added ability to specify coverage verification rules via settings or CLI Co-authored-by: Leonid Startsev <sandwwraith@users.noreply.github.com> PR #665
- Loading branch information
Showing
23 changed files
with
1,005 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...gradle-plugin/src/functionalTest/templates/builds/settings-plugin-verify/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright 2017-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
plugins { | ||
kotlin("jvm") version ("2.0.0") | ||
} | ||
|
||
dependencies { | ||
testImplementation(kotlin("test")) | ||
} | ||
|
63 changes: 63 additions & 0 deletions
63
...dle-plugin/src/functionalTest/templates/builds/settings-plugin-verify/settings.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
plugins { | ||
id("org.jetbrains.kotlinx.kover.aggregation") version "SNAPSHOT" | ||
} | ||
|
||
extensions.configure<kotlinx.kover.gradle.aggregation.settings.dsl.KoverSettingsExtension> { | ||
enableCoverage() | ||
|
||
reports { | ||
verify { | ||
warningInsteadOfFailure = true | ||
|
||
rule("named rule") { | ||
// should fail | ||
bound { | ||
minValue = 100 | ||
} | ||
} | ||
rule { | ||
// shoul pass because RootClass is fully covered | ||
name = "include class Rule" | ||
filters { | ||
includedClasses.add("tests.settings.root.RootClass") | ||
} | ||
bound { | ||
minValue = 100 | ||
} | ||
} | ||
rule { | ||
name = "included project" | ||
// shoul pass because project ':subproject' is fully covered | ||
filters { | ||
includedProjects.add(":subproject") | ||
} | ||
bound { | ||
minValue = 100 | ||
} | ||
} | ||
rule { | ||
// should fail | ||
bound { | ||
maxValue = 10 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
buildCache { | ||
local { | ||
directory = "$settingsDir/build-cache" | ||
} | ||
} | ||
|
||
rootProject.name = "settings-plugin-verify" | ||
|
||
include(":subproject") |
28 changes: 28 additions & 0 deletions
28
...n/src/functionalTest/templates/builds/settings-plugin-verify/src/main/kotlin/RootClass.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright 2017-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package tests.settings.root | ||
|
||
import java.lang.AutoCloseable | ||
|
||
class RootClass { | ||
fun action() { | ||
println("It's root class") | ||
} | ||
} | ||
|
||
class InheritedClass: AutoCloseable { | ||
override fun close() { | ||
println("close") | ||
} | ||
} | ||
|
||
annotation class Generated | ||
|
||
@Generated | ||
class AnnotatedClass { | ||
fun function() { | ||
println("function") | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...in/src/functionalTest/templates/builds/settings-plugin-verify/src/test/kotlin/RootTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright 2017-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package tests.settings.root | ||
|
||
import kotlin.test.Test | ||
|
||
class RootTest { | ||
@Test | ||
fun test() { | ||
RootClass().action() | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...in/src/functionalTest/templates/builds/settings-plugin-verify/subproject/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Copyright 2017-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
plugins { | ||
kotlin("jvm") | ||
} | ||
|
||
dependencies { | ||
testImplementation(kotlin("test")) | ||
} |
11 changes: 11 additions & 0 deletions
11
...est/templates/builds/settings-plugin-verify/subproject/src/main/kotlin/SubprojectClass.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Copyright 2017-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package tests.settings.subproject | ||
|
||
class SubprojectClass { | ||
fun action() { | ||
println("It's class from the subproject") | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...unctionalTest/templates/builds/settings-plugin-verify/subproject/src/test/kotlin/ATest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright 2017-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package tests.settings.subproject | ||
|
||
import kotlin.test.Test | ||
|
||
class SubprojectTest { | ||
@Test | ||
fun test() { | ||
SubprojectClass().action() | ||
} | ||
} |
Oops, something went wrong.