From 5e8192bf74b866e262d728468bcbb97758a9c801 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Fri, 12 Jul 2019 18:01:01 +0300 Subject: [PATCH] Make kotlin-test-js integration test tasks incremental Define their inputs and outputs, so they are run only when js files in build/node-modules change. These don't include external libraries node-modules --- libraries/kotlin.test/js/it/build.gradle | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libraries/kotlin.test/js/it/build.gradle b/libraries/kotlin.test/js/it/build.gradle index 49a690ce3ca..1cba035eef7 100644 --- a/libraries/kotlin.test/js/it/build.gradle +++ b/libraries/kotlin.test/js/it/build.gradle @@ -37,15 +37,22 @@ def createFrameworkTest(def name) { return tasks.create("test$name", NpmTask) { dependsOn(compileTestKotlin2Js, populateNodeModules, npmInstall) def lowerName = name.toLowerCase() + def tcOutput = "$buildDir/tc-${lowerName}.log" + def stdOutput = "$buildDir/test-${lowerName}.log" + def errOutput = "$buildDir/test-${lowerName}.err.log" + inputs.files(sourceSets.test.output) + inputs.dir("${buildDir}/node_modules") + outputs.files(tcOutput, stdOutput, errOutput) + args = ['run', "test-$lowerName"] group = 'verification' execOverrides { it.ignoreExitValue = true - it.standardOutput = new FileOutputStream("$buildDir/test-${lowerName}.log") - it.errorOutput = new FileOutputStream("$buildDir/test-${lowerName}.err.log") + it.standardOutput = new FileOutputStream(stdOutput) + it.errorOutput = new FileOutputStream(errOutput) } doLast { - println file("$buildDir/tc-${lowerName}.log").text + println file(tcOutput).text if (result.exitValue != 0 && !rootProject.ignoreTestFailures) { throw new GradleException("$name integration test failed") }