From 341e017261889c6160d289fbeadcc35c4dfe14e7 Mon Sep 17 00:00:00 2001 From: Dmitriy Dolovov Date: Wed, 15 Dec 2021 11:30:51 +0300 Subject: [PATCH] [Native][tests] Don't treat any compiler test task as up-to-date There are number of problems with up-to-date checks in tests, leading to a test binary not being rebuilt or rerun when a developer expects it to. Things became worse after updating to Gradle 7+: test binary run tasks are considered up-to-date if the test data has been changed, even after clean. Even before Gradle 7+, we've observed other similar undesirable effects: for example, if the compiler has been changed, tasks building test binaries are still up-to-date. So it was decided to workaround all possible similar problems by forcing all test tasks in the :native:native.tests project to be not up-to-date. This project should contain only test tasks, so this workaround seems pretty natural -- it is just "tests aren't up-to-date". --- native/native.tests/build.gradle.kts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/native/native.tests/build.gradle.kts b/native/native.tests/build.gradle.kts index 14b034a6bdb..38a63b7cbbc 100644 --- a/native/native.tests/build.gradle.kts +++ b/native/native.tests/build.gradle.kts @@ -62,7 +62,13 @@ enum class TestProperty(shortName: String) { fun Test.setUpBlackBoxTest(tag: String) { if (kotlinBuildProperties.isKotlinNativeEnabled) { dependsOn(":kotlin-native:dist") + workingDir = rootDir + outputs.upToDateWhen { + // Don't treat any test task as up-to-date, no matter what. + // Note: this project should contain only test tasks, including ones that build binaries, and ones that run binaries. + false + } maxHeapSize = "6G" // Extra heap space for Kotlin/Native compiler. jvmArgs("-XX:MaxJavaStackTraceDepth=1000000") // Effectively remove the limit for the amount of stack trace elements in Throwable.