diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicGradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicGradleIntegrationTest.kt index a6f13abb8f9..a23fb410370 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicGradleIntegrationTest.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicGradleIntegrationTest.kt @@ -31,14 +31,14 @@ class BasicGradleIntegrationTest : AbstractGradleIntegrationTest() { } } - @ParameterizedTest(name = "{0} {1}") - @ArgumentsSource(AllSupportedTestedVersionsWithK2SwitcherArgumentsProvider::class) - fun execute(buildVersions: BuildVersions, extraParameter: String) { - runAndAssertOutcome(buildVersions, TaskOutcome.SUCCESS, extraParameter) - runAndAssertOutcome(buildVersions, TaskOutcome.UP_TO_DATE, extraParameter) + @ParameterizedTest(name = "{0}") + @ArgumentsSource(AllSupportedTestedVersionsArgumentsProvider::class) + fun execute(buildVersions: BuildVersions) { + runAndAssertOutcome(buildVersions, TaskOutcome.SUCCESS) + runAndAssertOutcome(buildVersions, TaskOutcome.UP_TO_DATE) } - private fun runAndAssertOutcome(buildVersions: BuildVersions, expectedOutcome: TaskOutcome, extraParameter: String) { + private fun runAndAssertOutcome(buildVersions: BuildVersions, expectedOutcome: TaskOutcome) { val result = createGradleRunner( buildVersions, "dokkaHtml", @@ -46,8 +46,7 @@ class BasicGradleIntegrationTest : AbstractGradleIntegrationTest() { "dokkaGfm", "dokkaJekyll", "-i", - "-s", - extraParameter + "-s" ).buildRelaxed() assertEquals(expectedOutcome, assertNotNull(result.task(":dokkaHtml")).outcome) diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule0IntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule0IntegrationTest.kt index 58387534a41..54ac3ff8abf 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule0IntegrationTest.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule0IntegrationTest.kt @@ -21,15 +21,15 @@ class MultiModule0IntegrationTest : AbstractGradleIntegrationTest() { File(templateProjectDir, "moduleA").copyRecursively(File(projectDir, "moduleA")) } - @ParameterizedTest(name = "{0} {1}") - @ArgumentsSource(AllSupportedTestedVersionsWithK2SwitcherArgumentsProvider::class) - fun execute(buildVersions: BuildVersions, extraParameter: String) { + @ParameterizedTest(name = "{0}") + @ArgumentsSource(AllSupportedTestedVersionsArgumentsProvider::class) + fun execute(buildVersions: BuildVersions) { val result = createGradleRunner( buildVersions, ":moduleA:dokkaHtmlMultiModule", ":moduleA:dokkaGfmMultiModule", ":moduleA:dokkaJekyllMultiModule", - "-i", "-s", extraParameter + "-i", "-s" ).buildRelaxed() assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:dokkaHtmlMultiModule")).outcome) diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule1IntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule1IntegrationTest.kt index c6110a31bc3..59736344be8 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule1IntegrationTest.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule1IntegrationTest.kt @@ -28,13 +28,13 @@ class MultiModule1IntegrationTest : AbstractGradleIntegrationTest() { File(templateProjectDir, "second").copyRecursively(File(projectDir, "second")) } - @ParameterizedTest(name = "{0} {1}") - @ArgumentsSource(AllSupportedTestedVersionsWithK2SwitcherArgumentsProvider::class) - fun execute(buildVersions: BuildVersions, extraParameter: String) { + @ParameterizedTest(name = "{0}") + @ArgumentsSource(AllSupportedTestedVersionsArgumentsProvider::class) + fun execute(buildVersions: BuildVersions) { val result = createGradleRunner( buildVersions, ":second:dokkaHtml", - "-i", "-s", extraParameter + "-i", "-s" ).buildRelaxed() assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":second:dokkaHtml")).outcome) diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Multiplatform0GradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Multiplatform0GradleIntegrationTest.kt index a5538f5e5ca..d8f5cee254a 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Multiplatform0GradleIntegrationTest.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Multiplatform0GradleIntegrationTest.kt @@ -36,7 +36,7 @@ class Multiplatform0GradleIntegrationTest : AbstractGradleIntegrationTest() { "-i", "-s", "-Pkotlin.mpp.enableGranularSourceSetsMetadata=true", - "-Pkotlin.native.enableDependencyPropagation=false", + "-Pkotlin.native.enableDependencyPropagation=false" ).buildRelaxed() else createGradleRunner(buildVersions, "dokkaHtml", "-i", "-s").buildRelaxed() diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/TestedVersions.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/TestedVersions.kt index 491e3e8a1b9..e4634c09112 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/TestedVersions.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/TestedVersions.kt @@ -9,10 +9,8 @@ import org.junit.jupiter.params.provider.Arguments import org.junit.jupiter.params.provider.ArgumentsProvider import java.util.stream.Stream -const val useK2PropertyCLIArgument = "-Porg.jetbrains.dokka.experimental.tryK2=true" internal class LatestTestedVersionsArgumentsProvider : TestedVersionsArgumentsProvider(listOf(TestedVersions.LATEST)) internal open class AllSupportedTestedVersionsArgumentsProvider : TestedVersionsArgumentsProvider(TestedVersions.ALL_SUPPORTED) -internal open class AllSupportedTestedVersionsWithK2SwitcherArgumentsProvider : TestedVersionsWithK2SwitcherArgumentsProvider(TestedVersions.ALL_SUPPORTED) internal object TestedVersions { @@ -72,18 +70,3 @@ abstract class TestedVersionsArgumentsProvider(private val buildVersions: List) : - ArgumentsProvider { - override fun provideArguments(context: ExtensionContext?): Stream { - return (buildVersions.map { Arguments.of(it, "") } + if (TestEnvironment.disableK2Tests) emptyList() - else buildVersions.map { - Arguments.of( - it, useK2PropertyCLIArgument - ) - }).stream() - } -} diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/CoroutinesGradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/CoroutinesGradleIntegrationTest.kt index 884656b01a2..6f0d91882a6 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/CoroutinesGradleIntegrationTest.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/CoroutinesGradleIntegrationTest.kt @@ -9,22 +9,29 @@ import org.jetbrains.dokka.it.TestOutputCopier import org.jetbrains.dokka.it.copyAndApplyGitDiff import org.jetbrains.dokka.it.gradle.AbstractGradleIntegrationTest import org.jetbrains.dokka.it.gradle.BuildVersions -import org.jetbrains.dokka.it.gradle.TestedVersionsArgumentsProvider +import org.junit.jupiter.api.extension.ExtensionContext import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider import org.junit.jupiter.params.provider.ArgumentsSource import java.io.File +import java.util.stream.Stream import kotlin.test.BeforeTest import kotlin.test.assertEquals import kotlin.test.assertNotNull import kotlin.test.assertTrue -private val buildVersions = BuildVersions.permutations( - gradleVersions = listOf("7.4.2"), - kotlinVersions = listOf("1.8.10") -) +class CoroutinesBuildVersionsArgumentsProvider : ArgumentsProvider { + private val buildVersions = BuildVersions.permutations( + gradleVersions = listOf("7.4.2"), + kotlinVersions = listOf("1.8.10") + ) + + override fun provideArguments(context: ExtensionContext?): Stream { + return buildVersions.stream().map { Arguments.of(it) } + } +} -internal class CoroutinesBuildVersionsArgumentsProvider : - TestedVersionsArgumentsProvider(buildVersions) class CoroutinesGradleIntegrationTest : AbstractGradleIntegrationTest(), TestOutputCopier { override val projectOutputLocation: File by lazy { File(projectDir, "build/dokka/htmlMultiModule") } diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/SerializationGradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/SerializationGradleIntegrationTest.kt index d480046b104..ff2849b8dbf 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/SerializationGradleIntegrationTest.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/SerializationGradleIntegrationTest.kt @@ -9,22 +9,28 @@ import org.jetbrains.dokka.it.TestOutputCopier import org.jetbrains.dokka.it.copyAndApplyGitDiff import org.jetbrains.dokka.it.gradle.AbstractGradleIntegrationTest import org.jetbrains.dokka.it.gradle.BuildVersions -import org.jetbrains.dokka.it.gradle.TestedVersionsArgumentsProvider +import org.junit.jupiter.api.extension.ExtensionContext import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.ArgumentsProvider import org.junit.jupiter.params.provider.ArgumentsSource import java.io.File +import java.util.stream.Stream import kotlin.test.BeforeTest import kotlin.test.assertEquals import kotlin.test.assertNotNull import kotlin.test.assertTrue -private val buildVersions = BuildVersions.permutations( - gradleVersions = listOf("7.6.1"), - kotlinVersions = listOf("1.9.0") -) +class SerializationBuildVersionsArgumentsProvider : ArgumentsProvider { + private val buildVersions = BuildVersions.permutations( + gradleVersions = listOf("7.6.1"), + kotlinVersions = listOf("1.9.0") + ) -internal class SerializationBuildVersionsArgumentsProvider : - TestedVersionsArgumentsProvider(buildVersions) + override fun provideArguments(context: ExtensionContext?): Stream { + return buildVersions.stream().map { Arguments.of(it) } + } +} class SerializationGradleIntegrationTest : AbstractGradleIntegrationTest(), TestOutputCopier { diff --git a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt index 3a34632fcd8..f2b28578506 100644 --- a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt +++ b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/AbstractGradleIntegrationTest.kt @@ -42,7 +42,7 @@ public abstract class AbstractGradleIntegrationTest : AbstractIntegrationTest() "-Pdokka_it_android_gradle_plugin_version=$androidVersion" }, * arguments - ).filter { it.isNotBlank() } + ) ).run { this as DefaultGradleRunner } .withJvmArguments(jvmArgs) } diff --git a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/TestEnvironment.kt b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/TestEnvironment.kt index 962c640fc33..174060aab7b 100644 --- a/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/TestEnvironment.kt +++ b/integration-tests/gradle/src/main/kotlin/org/jetbrains/dokka/it/gradle/TestEnvironment.kt @@ -8,8 +8,6 @@ public object TestEnvironment { public val isExhaustive: Boolean = checkNotNull(System.getenv("isExhaustive")) { "Missing `isExhaustive` environment variable" }.toBoolean() - - public val disableK2Tests: Boolean = System.getenv("DISABLE_K2_TESTS").toBoolean() } /**