[Gradle] Update Configuration Cache test for Native tasks
Exclude Metadata Processing tasks that are not compatible yet ^KT-54339 Verification Pending
This commit is contained in:
committed by
Space Team
parent
512f7b3231
commit
50b892f2f1
+38
-24
@@ -11,6 +11,7 @@ import org.gradle.util.GradleVersion
|
|||||||
import org.jetbrains.kotlin.gradle.report.BuildReportType
|
import org.jetbrains.kotlin.gradle.report.BuildReportType
|
||||||
import org.jetbrains.kotlin.gradle.targets.js.dukat.ExternalsOutputFormat
|
import org.jetbrains.kotlin.gradle.targets.js.dukat.ExternalsOutputFormat
|
||||||
import org.jetbrains.kotlin.gradle.testbase.*
|
import org.jetbrains.kotlin.gradle.testbase.*
|
||||||
|
import org.jetbrains.kotlin.konan.target.HostManager
|
||||||
import org.junit.jupiter.api.DisplayName
|
import org.junit.jupiter.api.DisplayName
|
||||||
|
|
||||||
@DisplayName("Configuration cache")
|
@DisplayName("Configuration cache")
|
||||||
@@ -81,32 +82,45 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
|
|||||||
@GradleTestVersions(minVersion = TestVersions.Gradle.G_7_4)
|
@GradleTestVersions(minVersion = TestVersions.Gradle.G_7_4)
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testNativeTasks(gradleVersion: GradleVersion) {
|
fun testNativeTasks(gradleVersion: GradleVersion) {
|
||||||
|
val expectedTasks = mutableListOf(
|
||||||
|
":lib:cinteropMyCinteropLinuxX64",
|
||||||
|
":lib:commonizeCInterop",
|
||||||
|
":lib:compileKotlinLinuxX64",
|
||||||
|
":lib:copyCinteropMyCinteropLinuxX64",
|
||||||
|
":lib:linkExecutableDebugExecutableLinuxX64",
|
||||||
|
":lib:linkSharedDebugSharedLinuxX64",
|
||||||
|
":lib:linkStaticDebugStaticLinuxX64",
|
||||||
|
":lib:linkDebugTestLinuxX64",
|
||||||
|
)
|
||||||
|
|
||||||
|
if (HostManager.hostIsMac) {
|
||||||
|
expectedTasks += listOf(
|
||||||
|
":lib:cinteropMyCinteropIosX64",
|
||||||
|
":lib:compileKotlinIosX64",
|
||||||
|
":lib:copyCinteropMyCinteropIosX64",
|
||||||
|
":lib:assembleMyframeDebugFrameworkIosArm64",
|
||||||
|
":lib:assembleMyfatframeDebugFatFramework",
|
||||||
|
":lib:assembleLibDebugXCFramework",
|
||||||
|
":lib:compileTestKotlinIosX64",
|
||||||
|
":lib:linkDebugTestIosX64",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
project("native-configuration-cache", gradleVersion) {
|
project("native-configuration-cache", gradleVersion) {
|
||||||
val buildOptions = defaultBuildOptions.copy(
|
testConfigurationCacheOf(
|
||||||
configurationCacheProblems = BaseGradleIT.ConfigurationCacheProblems.FAIL,
|
"build",
|
||||||
warningMode = WarningMode.All
|
executedTaskNames = expectedTasks,
|
||||||
)
|
checkConfigurationCacheFileReport = false,
|
||||||
// These tasks currently don't support Configuration Cache and marked as [Task::notCompatibleWithConfigurationCache]
|
buildOptions = defaultBuildOptions.copy(
|
||||||
val configCacheIncompatibleTaskTypes = listOf(
|
configurationCacheProblems = BaseGradleIT.ConfigurationCacheProblems.FAIL,
|
||||||
"CInteropMetadataDependencyTransformationTask",
|
warningMode = WarningMode.All,
|
||||||
"MetadataDependencyTransformationTask"
|
freeArgs = listOf(
|
||||||
)
|
// remove after KT-49933 is fixed
|
||||||
|
"-x", ":lib:transformCommonMainDependenciesMetadata",
|
||||||
build("build", buildOptions = buildOptions) {
|
"-x", ":lib:transformCommonMainCInteropDependenciesMetadata",
|
||||||
// Reduce the problem numbers when a Task become compatible with GCC.
|
|
||||||
// When all tasks support GCC, replace these assertions with `testConfigurationCacheOf`
|
|
||||||
assertOutputContains("4 problems were found storing the configuration cache, 2 of which seem unique.")
|
|
||||||
configCacheIncompatibleTaskTypes.forEach { taskType ->
|
|
||||||
assertOutputContains(
|
|
||||||
"""Task `\S+` of type `[\w.]+$taskType`: .+(at execution time is unsupported)|(not supported with the configuration cache)"""
|
|
||||||
.toRegex()
|
|
||||||
)
|
)
|
||||||
}
|
)
|
||||||
|
)
|
||||||
// TODO: Enable `warningMode = Fail` back and remove these asserts when KGP supports Gradle 8.0
|
|
||||||
assertOutputContains("The TestReport.destinationDir property has been deprecated.")
|
|
||||||
assertOutputContains("The TestReport.reportOn(Object...) method has been deprecated.")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
fun foo() = "bar" + my.cinterop.foo()
|
fun foo() = "bar" //+ my.cinterop.foo()
|
||||||
|
|
||||||
fun main() = println(foo())
|
fun main() = println(foo())
|
||||||
+1
-1
@@ -5,6 +5,6 @@ class CommonTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun sampleTest() {
|
fun sampleTest() {
|
||||||
assertEquals("bar42", foo())
|
assertEquals("bar", foo())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user