aboutsummaryrefslogtreecommitdiff
path: root/integration-tests
diff options
context:
space:
mode:
Diffstat (limited to 'integration-tests')
-rw-r--r--integration-tests/build.gradle.kts79
-rw-r--r--integration-tests/cli/build.gradle.kts4
-rw-r--r--integration-tests/gradle/build.gradle.kts12
-rw-r--r--integration-tests/maven/build.gradle.kts5
4 files changed, 19 insertions, 81 deletions
diff --git a/integration-tests/build.gradle.kts b/integration-tests/build.gradle.kts
index 226b4b6f..80c07b37 100644
--- a/integration-tests/build.gradle.kts
+++ b/integration-tests/build.gradle.kts
@@ -1,80 +1,5 @@
-import org.gradle.api.tasks.testing.logging.TestExceptionFormat
-import org.gradle.api.tasks.testing.logging.TestLogEvent
-
-subprojects {
- sourceSets {
- create("integrationTest") {
- compileClasspath += sourceSets.main.get().output
- runtimeClasspath += sourceSets.main.get().output
- }
- }
-
- configurations.getByName("integrationTestImplementation") {
- extendsFrom(configurations.implementation.get())
- }
-
- configurations.getByName("integrationTestRuntimeOnly") {
- extendsFrom(configurations.runtimeOnly.get())
- }
-
- dependencies {
- implementation(project(":integration-tests"))
- }
-
- /**
- * Dokka's integration test task is not cacheable because the HTML outputs
- * it produces when running the tests are used for showcasing resulting documentation,
- * which does not work well with caching.
- *
- * At the moment there are two problems that do not allow to make it cacheable:
- *
- * 1. The task's inputs are such that changes in Dokka's code do not invalidate the cache,
- * because it is run with the same version of Dokka ("DOKKA_VERSION") on the same
- * test project inputs.
- * 2. The tests generate HTML output which is then used to showcase documentation.
- * The outputs are usually copied to a location from which it will be served.
- * However, if the test is cacheable, it produces no outputs, so no documentation
- * to showcase. It needs to be broken into two separate tasks: one cacheable for running
- * the tests and producing HTML output, and another non-cacheable for copying the output.
- *
- * @see [org.jetbrains.dokka.it.TestOutputCopier] for more details on showcasing documentation
- */
- @DisableCachingByDefault(because = "Contains incorrect inputs/outputs configuration, see the KDoc for details")
- abstract class NonCacheableIntegrationTest : Test()
-
- val integrationTest by tasks.register<NonCacheableIntegrationTest>("integrationTest") {
- maxHeapSize = "2G"
- description = "Runs integration tests."
- group = "verification"
- useJUnit()
-
-
- testClassesDirs = sourceSets["integrationTest"].output.classesDirs
- classpath = sourceSets["integrationTest"].runtimeClasspath
-
- 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()
- ?: System.getenv("DOKKA_INTEGRATION_TEST_IS_EXHAUSTIVE")?.toBoolean()
- ?: false.toString()
- )
-
- testLogging {
- exceptionFormat = TestExceptionFormat.FULL
- events(TestLogEvent.SKIPPED, TestLogEvent.FAILED)
- showExceptions = true
- showCauses = true
- showStackTraces = true
- }
- }
-
- tasks.check {
- dependsOn(integrationTest)
- }
+plugins {
+ org.jetbrains.conventions.`kotlin-jvm`
}
dependencies {
diff --git a/integration-tests/cli/build.gradle.kts b/integration-tests/cli/build.gradle.kts
index 33c2b827..71d36a9b 100644
--- a/integration-tests/cli/build.gradle.kts
+++ b/integration-tests/cli/build.gradle.kts
@@ -1,7 +1,7 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
-
plugins {
+ org.jetbrains.conventions.`dokka-integration-test`
id("com.github.johnrengelman.shadow")
}
@@ -12,6 +12,7 @@ evaluationDependsOn(":plugins:base")
dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("test-junit"))
+ implementation(project(":integration-tests"))
}
/* Create a fat base plugin jar for cli tests */
@@ -25,6 +26,7 @@ dependencies {
basePluginShadow(project(":plugins:base"))
basePluginShadow(project(":kotlin-analysis")) // compileOnly in base plugin
}
+
val basePluginShadowJar by tasks.register("basePluginShadowJar", ShadowJar::class) {
configurations = listOf(basePluginShadow)
archiveFileName.set("fat-base-plugin-$dokka_version.jar")
diff --git a/integration-tests/gradle/build.gradle.kts b/integration-tests/gradle/build.gradle.kts
index 0cb1dc12..3f3be54b 100644
--- a/integration-tests/gradle/build.gradle.kts
+++ b/integration-tests/gradle/build.gradle.kts
@@ -1,6 +1,11 @@
import org.jetbrains.dependsOnMavenLocalPublication
+plugins {
+ org.jetbrains.conventions.`dokka-integration-test`
+}
+
dependencies {
+ implementation(project(":integration-tests"))
implementation(kotlin("stdlib"))
implementation(kotlin("test-junit"))
implementation(gradleTestKit())
@@ -14,8 +19,9 @@ tasks.integrationTest {
environment("DOKKA_VERSION", dokka_version)
inputs.dir(file("projects"))
dependsOnMavenLocalPublication()
-}
-tasks.clean {
- delete(File(buildDir, "gradle-test-kit"))
+ javaLauncher.set(javaToolchains.launcherFor {
+ // kotlinx.coroutines requires Java 11+
+ languageVersion.set(JavaLanguageVersion.of(11))
+ })
}
diff --git a/integration-tests/maven/build.gradle.kts b/integration-tests/maven/build.gradle.kts
index 1c747bbc..0a2cb7c4 100644
--- a/integration-tests/maven/build.gradle.kts
+++ b/integration-tests/maven/build.gradle.kts
@@ -1,9 +1,14 @@
import org.jetbrains.SetupMaven
import org.jetbrains.dependsOnMavenLocalPublication
+plugins {
+ org.jetbrains.conventions.`dokka-integration-test`
+}
+
evaluationDependsOn(":runners:maven-plugin")
dependencies {
+ implementation(project(":integration-tests"))
implementation(kotlin("stdlib"))
implementation(kotlin("test-junit"))
}