aboutsummaryrefslogtreecommitdiff
path: root/build-logic/src/main/kotlin
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2023-08-30 15:58:46 +0200
committerGitHub <noreply@github.com>2023-08-30 15:58:46 +0200
commitc63ea36637ce956029fb15b1482c0683ecb8a587 (patch)
tree2b75a8a976b43530820e73dc60cce4b10d9fc005 /build-logic/src/main/kotlin
parent0e00edc6fcd406fcf38673ef6a2f8f59e8374de2 (diff)
downloaddokka-c63ea36637ce956029fb15b1482c0683ecb8a587.tar.gz
dokka-c63ea36637ce956029fb15b1482c0683ecb8a587.tar.bz2
dokka-c63ea36637ce956029fb15b1482c0683ecb8a587.zip
Migrate to JUnit 5 and unify used test API (#3138)
Diffstat (limited to 'build-logic/src/main/kotlin')
-rw-r--r--build-logic/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts16
-rw-r--r--build-logic/src/main/kotlin/org/jetbrains/conventions/dokka-integration-test.gradle.kts6
2 files changed, 6 insertions, 16 deletions
diff --git a/build-logic/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts b/build-logic/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts
index a4ed0ede..efeb8b17 100644
--- a/build-logic/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts
+++ b/build-logic/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts
@@ -27,24 +27,12 @@ tasks.withType<Test>().configureEach {
} else {
(Runtime.getRuntime().availableProcessors() / 2).takeIf { it > 0 } ?: 1
}
+
javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(dokkaBuild.testJavaLauncherVersion)
})
}
dependencies {
- testImplementation(platform("org.junit:junit-bom:5.9.2"))
- // TODO Upgrade all subprojects to use JUnit Jupiter https://github.com/Kotlin/dokka/issues/2924
- // Replace these dependencies with `testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")`
- // See https://junit.org/junit5/docs/current/user-guide/#running-tests-build-gradle-engines-configure
- // Ideally convention plugins should only provide sensible defaults that can be overridden by subprojects.
- // If a convention plugin defines dependencies, these cannot be easily overridden by subprojects, and so
- // this should be avoided. However, for now , both JUnit 4 and 5 must be supported, and since these are test
- // runtime-only dependencies they are not going to have a significant impact subprojects.
- // These dependencies should be revisited in #2924, and (for example) moved to each subproject (which is more
- // repetitive, but more declarative and clear), or some other solution.
- testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
- testRuntimeOnly("org.junit.vintage:junit-vintage-engine")
- // kotlin-test asserts for all projects
- testImplementation(kotlin("test-junit"))
+ testImplementation(platform(libs.junit.bom))
}
diff --git a/build-logic/src/main/kotlin/org/jetbrains/conventions/dokka-integration-test.gradle.kts b/build-logic/src/main/kotlin/org/jetbrains/conventions/dokka-integration-test.gradle.kts
index f9edb68e..cebdb541 100644
--- a/build-logic/src/main/kotlin/org/jetbrains/conventions/dokka-integration-test.gradle.kts
+++ b/build-logic/src/main/kotlin/org/jetbrains/conventions/dokka-integration-test.gradle.kts
@@ -45,15 +45,17 @@ val integrationTest by tasks.registering(NonCacheableIntegrationTest::class) {
maxHeapSize = "2G"
description = "Runs integration tests."
group = "verification"
- useJUnit()
-
testClassesDirs = integrationTestSourceSet.output.classesDirs
classpath = integrationTestSourceSet.runtimeClasspath
+ useJUnitPlatform()
+
setForkEvery(1)
project.properties["dokka_integration_test_parallelism"]?.toString()?.toIntOrNull()?.let { parallelism ->
maxParallelForks = parallelism
}
+
+
environment(
"isExhaustive",
project.properties["dokka_integration_test_is_exhaustive"]?.toString()?.toBoolean()