From d43fdfeb223a635a29ab3db5f914c68c58645ae6 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Wed, 4 May 2022 20:42:59 +0200 Subject: [PATCH] [Gradle][MPP] CInteropIdeaSyncIT: Ignore assertion after running leniently failed task again. KT-52243 --- .../gradle/native/CInteropIdeaSyncIT.kt | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/CInteropIdeaSyncIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/CInteropIdeaSyncIT.kt index 625c37fda33..60a985463f5 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/CInteropIdeaSyncIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/CInteropIdeaSyncIT.kt @@ -32,11 +32,25 @@ class CInteropIdeaSyncIT : BaseGradleIT() { assertContains(ideaSyncWarningMessage) } - /* Task is not considered up-to-date after lenient failure */ - build("commonize", options = ideaSyncBuildOptions) { - assertSuccessful() - assertTasksExecuted(interopTaskName) - assertContains(ideaSyncWarningMessage) + /* + The implementation before fixing KT-52243 considered the cinterop task as *not* up-to-date + when it was previously running in the IDE and therefore failing leniently. It would have always tried to re-run + this task to anticipate untracked environmental changes. + + This cannot be easily implemented whilst also fixing KT-52243, which is more desirable. + A new mechanism for 'run tasks at import' leniency is proposed (using --continue), which is supposed to replace + the special cinterop mechanism. + + https://youtrack.jetbrains.com/issue/KT-52243/ + https://github.com/JetBrains/kotlin/pull/4812#issuecomment-1117287222 + */ + runCatching { + /* Task is not considered up-to-date after lenient failure */ + build("commonize", options = ideaSyncBuildOptions) { + assertSuccessful() + assertTasksExecuted(interopTaskName) + assertContains(ideaSyncWarningMessage) + } } /* Remove noise that causes failure */