-
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.
- fixed small bug with non-existing binary report files - added ability to skip projects - added ability to limit instrumented class globally and locally in a project - added ability to exclude test task from instrumentation in a project config - implement feature to check verification rule on every project PR #689 Co-authored-by: Leonid Startsev <[email protected]>
- Loading branch information
1 parent
eaf3a92
commit 1acc054
Showing
37 changed files
with
922 additions
and
97 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
12 changes: 12 additions & 0 deletions
12
...ugin/src/functionalTest/templates/builds/settings-plugin-instrumentation/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")) | ||
} | ||
|
27 changes: 27 additions & 0 deletions
27
...n/src/functionalTest/templates/builds/settings-plugin-instrumentation/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,27 @@ | ||
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
plugins { | ||
id("org.jetbrains.kotlinx.kover.aggregation") version "SNAPSHOT" | ||
} | ||
|
||
extensions.configure<kotlinx.kover.gradle.aggregation.settings.dsl.KoverSettingsExtension> { | ||
enableCoverage() | ||
|
||
instrumentation.excludedClasses.add("*Class") | ||
} | ||
|
||
buildCache { | ||
local { | ||
directory = "$settingsDir/build-cache" | ||
} | ||
} | ||
|
||
rootProject.name = "settings-plugin-verify" | ||
|
||
include(":subproject") | ||
include(":subproject2") |
19 changes: 19 additions & 0 deletions
19
...ctionalTest/templates/builds/settings-plugin-instrumentation/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,19 @@ | ||
/* | ||
* 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 Tested { | ||
fun action() { | ||
println("It's tested root class") | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...nctionalTest/templates/builds/settings-plugin-instrumentation/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,15 @@ | ||
/* | ||
* 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() | ||
Tested().action() | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...nctionalTest/templates/builds/settings-plugin-instrumentation/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")) | ||
} |
17 changes: 17 additions & 0 deletions
17
...ates/builds/settings-plugin-instrumentation/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,17 @@ | ||
/* | ||
* 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") | ||
} | ||
} | ||
|
||
class Tested { | ||
fun action() { | ||
println("It's tested subproject class") | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...Test/templates/builds/settings-plugin-instrumentation/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,15 @@ | ||
/* | ||
* 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() | ||
Tested().action() | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...ctionalTest/templates/builds/settings-plugin-instrumentation/subproject2/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,17 @@ | ||
/* | ||
* Copyright 2017-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
import kotlinx.kover.gradle.aggregation.settings.dsl.* | ||
|
||
plugins { | ||
kotlin("jvm") | ||
} | ||
|
||
dependencies { | ||
testImplementation(kotlin("test")) | ||
} | ||
|
||
extensions.configure<KoverProjectExtension> { | ||
instrumentation.disabledForTestTasks.add("test") | ||
} |
17 changes: 17 additions & 0 deletions
17
...es/builds/settings-plugin-instrumentation/subproject2/src/main/kotlin/Subproject2Class.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,17 @@ | ||
/* | ||
* Copyright 2017-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package tests.settings.subproject2 | ||
|
||
class Subproject2Class { | ||
fun action() { | ||
println("It's class from the subproject2") | ||
} | ||
} | ||
|
||
class Tested { | ||
fun action() { | ||
println("It's tested subproject2 class") | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...est/templates/builds/settings-plugin-instrumentation/subproject2/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,15 @@ | ||
/* | ||
* Copyright 2017-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package tests.settings.subproject2 | ||
|
||
import kotlin.test.Test | ||
|
||
class Subproject2Test { | ||
@Test | ||
fun test() { | ||
Subproject2Class().action() | ||
Tested().action() | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...e-plugin/src/functionalTest/templates/builds/settings-plugin-verify-each/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,15 @@ | ||
/* | ||
* 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 { | ||
implementation(project(":subproject")) | ||
implementation(project(":ignored")) | ||
|
||
testImplementation(kotlin("test")) | ||
} | ||
|
11 changes: 11 additions & 0 deletions
11
.../src/functionalTest/templates/builds/settings-plugin-verify-each/ignored/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
...t/templates/builds/settings-plugin-verify-each/ignored/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.ignored | ||
|
||
class SubprojectClass { | ||
fun action() { | ||
println("It's class from the subproject") | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...ctionalTest/templates/builds/settings-plugin-verify-each/ignored/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.ignored | ||
|
||
import kotlin.test.Test | ||
|
||
class SubprojectTest { | ||
@Test | ||
fun test() { | ||
SubprojectClass().action() | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...lugin/src/functionalTest/templates/builds/settings-plugin-verify-each/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,46 @@ | ||
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
import kotlinx.kover.gradle.aggregation.settings.dsl.* | ||
|
||
plugins { | ||
id("org.jetbrains.kotlinx.kover.aggregation") version "SNAPSHOT" | ||
} | ||
|
||
extensions.configure<kotlinx.kover.gradle.aggregation.settings.dsl.KoverSettingsExtension> { | ||
enableCoverage() | ||
|
||
skipProjects( | ||
// skip root project and everything works ok | ||
// skip by path | ||
":", | ||
// skip by project name | ||
"ignored" | ||
) | ||
|
||
reports { | ||
verify { | ||
warningInsteadOfFailure = true | ||
|
||
eachProjectRule { | ||
minBound(100) | ||
} | ||
} | ||
} | ||
} | ||
|
||
buildCache { | ||
local { | ||
directory = "$settingsDir/build-cache" | ||
} | ||
} | ||
|
||
rootProject.name = "settings-plugin-verify" | ||
|
||
include(":subproject") | ||
include(":subproject2") | ||
include(":ignored") |
Oops, something went wrong.