Skip to content

Commit

Permalink
Revert integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vmishenev committed Nov 9, 2023
1 parent cf98cb1 commit 52b15ae
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,22 @@ 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",
"dokkaJavadoc",
"dokkaGfm",
"dokkaJekyll",
"-i",
"-s",
extraParameter
"-s"
).buildRelaxed()

assertEquals(expectedOutcome, assertNotNull(result.task(":dokkaHtml")).outcome)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -72,18 +70,3 @@ abstract class TestedVersionsArgumentsProvider(private val buildVersions: List<B
return buildVersions.stream().map { Arguments.of(it) }
}
}

/**
* The first argument is [BuildVersions], the second one is an extra CLI argument for Gradle
*/
internal abstract class TestedVersionsWithK2SwitcherArgumentsProvider(private val buildVersions: List<BuildVersions>) :
ArgumentsProvider {
override fun provideArguments(context: ExtensionContext?): Stream<out Arguments> {
return (buildVersions.map { Arguments.of(it, "") } + if (TestEnvironment.disableK2Tests) emptyList()
else buildVersions.map {
Arguments.of(
it, useK2PropertyCLIArgument
)
}).stream()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<out Arguments> {
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") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<out Arguments> {
return buildVersions.stream().map { Arguments.of(it) }
}
}

class SerializationGradleIntegrationTest : AbstractGradleIntegrationTest(), TestOutputCopier {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

/**
Expand Down
2 changes: 1 addition & 1 deletion subprojects/analysis-kotlin-symbols/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {

dependencies {
compileOnly(projects.core)
implementation(projects.subprojects.analysisKotlinApi)
compileOnly(projects.subprojects.analysisKotlinApi)

implementation(projects.subprojects.analysisMarkdownJb)
implementation(projects.subprojects.analysisJavaPsi)
Expand Down

0 comments on commit 52b15ae

Please sign in to comment.