[Gradle] Fixed CC connected IT
Also provided a Configuration Cache Integration Test for downloading K/N ^KT-66422
This commit is contained in:
committed by
Space Team
parent
fae50f1258
commit
a2a0e8cb38
+42
-26
@@ -11,6 +11,7 @@ import org.jetbrains.kotlin.gradle.report.BuildReportType
|
|||||||
import org.jetbrains.kotlin.gradle.testbase.*
|
import org.jetbrains.kotlin.gradle.testbase.*
|
||||||
import org.jetbrains.kotlin.gradle.util.replaceText
|
import org.jetbrains.kotlin.gradle.util.replaceText
|
||||||
import org.junit.jupiter.api.DisplayName
|
import org.junit.jupiter.api.DisplayName
|
||||||
|
import org.junit.jupiter.api.condition.OS
|
||||||
import org.junit.jupiter.api.io.TempDir
|
import org.junit.jupiter.api.io.TempDir
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
|
|
||||||
@@ -69,9 +70,7 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
|
|||||||
)
|
)
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testMppWithMavenPublish(gradleVersion: GradleVersion) {
|
fun testMppWithMavenPublish(gradleVersion: GradleVersion) {
|
||||||
// with Configuration Cache we currently have such problem KT-66423
|
project("new-mpp-lib-and-app/sample-lib", gradleVersion) {
|
||||||
val buildOptions = buildOptionsToAvoidKT66423(gradleVersion)
|
|
||||||
project("new-mpp-lib-and-app/sample-lib", gradleVersion, buildOptions = buildOptions) {
|
|
||||||
val publishedTargets = listOf("kotlinMultiplatform", "jvm6", "nodeJs", "linux64", "mingw64")
|
val publishedTargets = listOf("kotlinMultiplatform", "jvm6", "nodeJs", "linux64", "mingw64")
|
||||||
testConfigurationCacheOf(
|
testConfigurationCacheOf(
|
||||||
*(publishedTargets.map { ":publish${it.replaceFirstChar { it.uppercaseChar() }}PublicationToMavenRepository" }
|
*(publishedTargets.map { ":publish${it.replaceFirstChar { it.uppercaseChar() }}PublicationToMavenRepository" }
|
||||||
@@ -89,9 +88,7 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
|
|||||||
)
|
)
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testAllMetadataJarWithConfigurationCache(gradleVersion: GradleVersion) {
|
fun testAllMetadataJarWithConfigurationCache(gradleVersion: GradleVersion) {
|
||||||
// with Configuration Cache we currently have such problem KT-66423
|
project("new-mpp-lib-and-app/sample-lib", gradleVersion) {
|
||||||
val buildOptions = buildOptionsToAvoidKT66423(gradleVersion)
|
|
||||||
project("new-mpp-lib-and-app/sample-lib", gradleVersion, buildOptions = buildOptions) {
|
|
||||||
testConfigurationCacheOf(":allMetadataJar")
|
testConfigurationCacheOf(":allMetadataJar")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,9 +101,7 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
|
|||||||
)
|
)
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testCommonizer(gradleVersion: GradleVersion) {
|
fun testCommonizer(gradleVersion: GradleVersion) {
|
||||||
// with Configuration Cache we currently have such problem KT-66423
|
project("native-configuration-cache", gradleVersion) {
|
||||||
val buildOptions = buildOptionsToAvoidKT66423(gradleVersion)
|
|
||||||
project("native-configuration-cache", gradleVersion, buildOptions = buildOptions) {
|
|
||||||
build(":cleanNativeDistributionCommonization")
|
build(":cleanNativeDistributionCommonization")
|
||||||
|
|
||||||
build(":lib:compileCommonMainKotlinMetadata") {
|
build(":lib:compileCommonMainKotlinMetadata") {
|
||||||
@@ -128,6 +123,32 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NativeGradlePluginTests
|
||||||
|
@DisplayName("Configuration cache works with Kotlin Native bundle and its dependencies downloading")
|
||||||
|
@GradleTestVersions(
|
||||||
|
minVersion = TestVersions.Gradle.G_7_4,
|
||||||
|
additionalVersions = [TestVersions.Gradle.G_7_6],
|
||||||
|
)
|
||||||
|
@OsCondition(
|
||||||
|
supportedOn = [OS.LINUX, OS.MAC], // disabled on Windows because of tmp dir problem KT-62761
|
||||||
|
enabledOnCI = [OS.LINUX, OS.MAC],
|
||||||
|
)
|
||||||
|
@GradleTest
|
||||||
|
fun testWithDownloadingKotlinNativeAndDependencies(gradleVersion: GradleVersion, @TempDir konanTempDir: Path) {
|
||||||
|
// with Configuration Cache we currently have such problem KT-66423
|
||||||
|
val buildOptions = buildOptionsToAvoidKT66423(gradleVersion, konanTempDir)
|
||||||
|
project("native-configuration-cache", gradleVersion, buildOptions = buildOptions) {
|
||||||
|
|
||||||
|
build(":lib:compileCommonMainKotlinMetadata") {
|
||||||
|
assertConfigurationCacheStored()
|
||||||
|
}
|
||||||
|
|
||||||
|
build(":lib:compileCommonMainKotlinMetadata") {
|
||||||
|
assertConfigurationCacheReused()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@NativeGradlePluginTests
|
@NativeGradlePluginTests
|
||||||
@GradleTestVersions(
|
@GradleTestVersions(
|
||||||
minVersion = TestVersions.Gradle.G_7_4,
|
minVersion = TestVersions.Gradle.G_7_4,
|
||||||
@@ -135,9 +156,7 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
|
|||||||
)
|
)
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testCInteropCommonizer(gradleVersion: GradleVersion) {
|
fun testCInteropCommonizer(gradleVersion: GradleVersion) {
|
||||||
// with Configuration Cache we currently have such problem KT-66423
|
project("native-configuration-cache", gradleVersion) {
|
||||||
val buildOptions = buildOptionsToAvoidKT66423(gradleVersion)
|
|
||||||
project("native-configuration-cache", gradleVersion, buildOptions = buildOptions) {
|
|
||||||
testConfigurationCacheOf(":lib:commonizeCInterop")
|
testConfigurationCacheOf(":lib:commonizeCInterop")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -287,18 +306,8 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
|
|||||||
|
|
||||||
abstract class AbstractConfigurationCacheIT : KGPBaseTest() {
|
abstract class AbstractConfigurationCacheIT : KGPBaseTest() {
|
||||||
|
|
||||||
@TempDir
|
override val defaultBuildOptions =
|
||||||
lateinit var konanDataTempDir: Path
|
super.defaultBuildOptions.copy(configurationCache = true)
|
||||||
|
|
||||||
override val defaultBuildOptions
|
|
||||||
get() = super.defaultBuildOptions.copy(
|
|
||||||
configurationCache = true,
|
|
||||||
konanDataDir = konanDataTempDir,
|
|
||||||
nativeOptions = super.defaultBuildOptions.nativeOptions.copy(
|
|
||||||
// set the KGP's default Kotlin Native version, because in CI we don't have K/N versions in maven repo for each build
|
|
||||||
version = null
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
protected fun TestProject.testConfigurationCacheOf(
|
protected fun TestProject.testConfigurationCacheOf(
|
||||||
vararg taskNames: String,
|
vararg taskNames: String,
|
||||||
@@ -314,7 +323,7 @@ abstract class AbstractConfigurationCacheIT : KGPBaseTest() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun buildOptionsToAvoidKT66423(gradleVersion: GradleVersion) =
|
protected fun buildOptionsToAvoidKT66423(gradleVersion: GradleVersion, konanTempDir: Path) =
|
||||||
if (gradleVersion == GradleVersion.version(TestVersions.Gradle.G_8_6)) {
|
if (gradleVersion == GradleVersion.version(TestVersions.Gradle.G_8_6)) {
|
||||||
defaultBuildOptions.copy(
|
defaultBuildOptions.copy(
|
||||||
konanDataDir = konanDir,
|
konanDataDir = konanDir,
|
||||||
@@ -322,5 +331,12 @@ abstract class AbstractConfigurationCacheIT : KGPBaseTest() {
|
|||||||
version = System.getProperty("kotlinNativeVersion")
|
version = System.getProperty("kotlinNativeVersion")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
} else defaultBuildOptions
|
} else defaultBuildOptions.copy(
|
||||||
|
configurationCache = true,
|
||||||
|
konanDataDir = konanTempDir,
|
||||||
|
nativeOptions = super.defaultBuildOptions.nativeOptions.copy(
|
||||||
|
// set the KGP's default Kotlin Native version, because in CI we don't have K/N versions in maven repo for each build
|
||||||
|
version = null
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-3
@@ -54,9 +54,7 @@ class MacosCapableConfigurationCacheIT : AbstractConfigurationCacheIT() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// with Configuration Cache we currently have such problem KT-66423
|
project("native-configuration-cache", gradleVersion) {
|
||||||
val buildOptions = buildOptionsToAvoidKT66423(gradleVersion)
|
|
||||||
project("native-configuration-cache", gradleVersion, buildOptions = buildOptions) {
|
|
||||||
testConfigurationCacheOf(
|
testConfigurationCacheOf(
|
||||||
"build",
|
"build",
|
||||||
executedTaskNames = expectedTasks,
|
executedTaskNames = expectedTasks,
|
||||||
|
|||||||
Reference in New Issue
Block a user