[Build] Update gradle-node-plugin to 3.2.1
#KT-44611 In Progress
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import com.moowork.gradle.node.npm.NpmTask
|
||||
import com.github.gradle.node.npm.task.NpmTask
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinUsages
|
||||
import org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink
|
||||
@@ -6,14 +6,14 @@ import java.io.FileOutputStream
|
||||
|
||||
plugins {
|
||||
kotlin("js")
|
||||
id("com.github.node-gradle.node") version "2.2.0"
|
||||
id("com.github.node-gradle.node") version "3.2.1"
|
||||
}
|
||||
|
||||
description = "Kotlin-test integration tests for JS IR"
|
||||
|
||||
node {
|
||||
version = "16.13.0"
|
||||
download = true
|
||||
version.set("16.13.0")
|
||||
download.set(true)
|
||||
}
|
||||
|
||||
val jsMainSources by task<Sync> {
|
||||
@@ -75,28 +75,30 @@ val populateNodeModules = tasks.register<Copy>("populateNodeModules") {
|
||||
fun createFrameworkTest(name: String): TaskProvider<NpmTask> {
|
||||
return tasks.register("test$name", NpmTask::class.java) {
|
||||
dependsOn(compileTestDevelopmentExecutableKotlinJs, populateNodeModules, "npmInstall")
|
||||
val testName = name
|
||||
val lowerName = name.toLowerCase()
|
||||
val tcOutput = "$buildDir/tc-${lowerName}.log"
|
||||
val tcOutput = project.file("$buildDir/tc-${lowerName}.log")
|
||||
val stdOutput = "$buildDir/test-${lowerName}.log"
|
||||
val errOutput = "$buildDir/test-${lowerName}.err.log"
|
||||
val exitCodeFile = project.file("$buildDir/test-${lowerName}.exit-code")
|
||||
// inputs.files(sourceSets.test.output)
|
||||
inputs.dir("${buildDir}/node_modules")
|
||||
outputs.files(tcOutput, stdOutput, errOutput)
|
||||
outputs.files(tcOutput, stdOutput, errOutput, exitCodeFile)
|
||||
|
||||
setArgs(listOf("run", "test-$lowerName"))
|
||||
args.set(listOf("run", "test-$lowerName"))
|
||||
// args("run")
|
||||
// args("test-$lowerName")
|
||||
group = "verification"
|
||||
|
||||
setExecOverrides(closureOf<ExecSpec> {
|
||||
execOverrides {
|
||||
isIgnoreExitValue = true
|
||||
standardOutput = FileOutputStream(stdOutput)
|
||||
errorOutput = FileOutputStream(errOutput)
|
||||
})
|
||||
}
|
||||
doLast {
|
||||
println(file(tcOutput).readText())
|
||||
if (result.exitValue != 0/* && !rootProject.ignoreTestFailures*/) {
|
||||
throw GradleException("$name integration test failed")
|
||||
println(tcOutput.readText())
|
||||
if (exitCodeFile.readText() != "0" /* && !rootProject.ignoreTestFailures*/) {
|
||||
throw GradleException("$testName integration test failed")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,8 +2,7 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinUsages
|
||||
|
||||
plugins {
|
||||
// TODO: update gradle-node-plugin to support configuration cache
|
||||
id "com.github.node-gradle.node" version "2.2.0"
|
||||
id "com.github.node-gradle.node" version "3.2.1"
|
||||
}
|
||||
|
||||
description = 'Kotlin-test integration tests for JS'
|
||||
@@ -59,13 +58,15 @@ node {
|
||||
def createFrameworkTest(def name) {
|
||||
return tasks.register("test$name", NpmTask) {
|
||||
dependsOn(compileTestKotlin2Js, populateNodeModules, npmInstall)
|
||||
def testName = name
|
||||
def lowerName = name.toLowerCase()
|
||||
def tcOutput = "$buildDir/tc-${lowerName}.log"
|
||||
def tcOutput = project.file("$buildDir/tc-${lowerName}.log")
|
||||
def stdOutput = "$buildDir/test-${lowerName}.log"
|
||||
def errOutput = "$buildDir/test-${lowerName}.err.log"
|
||||
def exitCodeFile = project.file("$buildDir/test-${lowerName}.exit-code")
|
||||
inputs.files(sourceSets.test.output)
|
||||
inputs.dir("${buildDir}/node_modules")
|
||||
outputs.files(tcOutput, stdOutput, errOutput)
|
||||
outputs.files(tcOutput, stdOutput, errOutput, exitCodeFile)
|
||||
|
||||
args = ['run', "test-$lowerName"]
|
||||
group = 'verification'
|
||||
@@ -74,12 +75,13 @@ def createFrameworkTest(def name) {
|
||||
it.standardOutput = new FileOutputStream(stdOutput)
|
||||
it.errorOutput = new FileOutputStream(errOutput)
|
||||
}
|
||||
doLast {
|
||||
println file(tcOutput).text
|
||||
if (result.exitValue != 0 && !rootProject.ignoreTestFailures) {
|
||||
throw new GradleException("$name integration test failed")
|
||||
}
|
||||
|
||||
def ignoreTestFailures = rootProject.ignoreTestFailures
|
||||
doLast {
|
||||
println tcOutput.text
|
||||
if (exitCodeFile.text != "0" && !ignoreTestFailures) {
|
||||
throw new GradleException("$testName integration test failed")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ Tester.prototype.printResult = function () {
|
||||
}
|
||||
|
||||
fs.writeFileSync('build/tc-' + this._frameworkName + '.log', message);
|
||||
fs.writeFileSync('build/test-' + this._frameworkName + '.exit-code', this.exitCode().toString());
|
||||
};
|
||||
|
||||
Tester.prototype.exitCode = function () {
|
||||
|
||||
@@ -4,7 +4,7 @@ description = "Simple Kotlin/JS tests runner with TeamCity reporter"
|
||||
|
||||
plugins {
|
||||
id("base")
|
||||
id("com.github.node-gradle.node") version "3.0.1"
|
||||
id("com.github.node-gradle.node") version "3.2.1"
|
||||
}
|
||||
|
||||
publish()
|
||||
|
||||
Reference in New Issue
Block a user