rra/ilgonmic/dry-run-wo-output
[Gradle, JS] Use assertOutputDoesNotContain [Gradle, JS] Add test on no output for dry run in gradle tests [Gradle, JS] No output for dry run in gradle tests Merge-request: KT-MR-6029 Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com> ^KT-51895 fixed
This commit is contained in:
+5
@@ -32,6 +32,7 @@ import kotlin.io.path.*
|
|||||||
import kotlin.streams.toList
|
import kotlin.streams.toList
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
import kotlin.test.assertFalse
|
import kotlin.test.assertFalse
|
||||||
|
import kotlin.test.assertNotEquals
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
|
|
||||||
@JsGradlePluginTests
|
@JsGradlePluginTests
|
||||||
@@ -1113,6 +1114,10 @@ abstract class AbstractKotlin2JsGradlePluginIT(protected val irBackend: Boolean)
|
|||||||
@GradleTest
|
@GradleTest
|
||||||
fun testMochaFailedModuleNotFound(gradleVersion: GradleVersion) {
|
fun testMochaFailedModuleNotFound(gradleVersion: GradleVersion) {
|
||||||
project("kotlin-js-nodejs-project", gradleVersion) {
|
project("kotlin-js-nodejs-project", gradleVersion) {
|
||||||
|
build("nodeTest") {
|
||||||
|
assertOutputDoesNotContain("##teamcity[")
|
||||||
|
}
|
||||||
|
|
||||||
projectPath.resolve("src/test/kotlin/Tests.kt").appendText(
|
projectPath.resolve("src/test/kotlin/Tests.kt").appendText(
|
||||||
"\n" + """
|
"\n" + """
|
||||||
|
|
|
|
||||||
|
|||||||
+12
@@ -15,6 +15,7 @@ import org.gradle.process.internal.ExecHandle
|
|||||||
import org.gradle.process.internal.ExecHandleFactory
|
import org.gradle.process.internal.ExecHandleFactory
|
||||||
import org.slf4j.Logger
|
import org.slf4j.Logger
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
|
import java.io.OutputStream
|
||||||
|
|
||||||
open class TCServiceMessagesTestExecutionSpec(
|
open class TCServiceMessagesTestExecutionSpec(
|
||||||
val forkOptions: ProcessForkOptions,
|
val forkOptions: ProcessForkOptions,
|
||||||
@@ -53,6 +54,17 @@ class TCServiceMessagesTestExecutor(
|
|||||||
val exec = execHandleFactory.newExec()
|
val exec = execHandleFactory.newExec()
|
||||||
spec.forkOptions.copyTo(exec)
|
spec.forkOptions.copyTo(exec)
|
||||||
exec.args = spec.args
|
exec.args = spec.args
|
||||||
|
// We do not need output by dry run of tests
|
||||||
|
exec.standardOutput = object : OutputStream() {
|
||||||
|
override fun write(b: Int) {
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exec.errorOutput = object : OutputStream() {
|
||||||
|
override fun write(b: Int) {
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
execHandle = exec.build()
|
execHandle = exec.build()
|
||||||
|
|
||||||
execHandle.start()
|
execHandle.start()
|
||||||
|
|||||||
Reference in New Issue
Block a user