diff --git a/CHANGELOG.md b/CHANGELOG.md index 52a49de02..30b2a3c54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,9 @@ TODO add summary * `viash test`: Fix Docker id between build and test components not being consistent when using a custom Docker registry (PR #679). +* `MainNSBuildNativeSuite`: Capture the error message when reading the configs so we can capture the expected warning message (PR #688). + While almost all tests were already cleanly capturing their expected warning/error messages, this one was still remaining, resulting in warnings being shown in the output. + # Viash 0.9.0-RC2 (2024-02-23): Restructure the config and change some default values The `.functionality` layer has been removed from the config and all fields have been moved to the top layer. diff --git a/src/test/scala/io/viash/e2e/ns_build/MainNSBuildNativeSuite.scala b/src/test/scala/io/viash/e2e/ns_build/MainNSBuildNativeSuite.scala index 1fabf7bf5..7501b6356 100644 --- a/src/test/scala/io/viash/e2e/ns_build/MainNSBuildNativeSuite.scala +++ b/src/test/scala/io/viash/e2e/ns_build/MainNSBuildNativeSuite.scala @@ -10,6 +10,7 @@ import org.scalatest.funsuite.AnyFunSuite import java.io.File import java.nio.file.Paths import scala.io.Source +import java.io.ByteArrayOutputStream class MainNSBuildNativeSuite extends AnyFunSuite with BeforeAndAfterAll{ Logger.UseColorOverride.value = Some(false) @@ -65,7 +66,12 @@ class MainNSBuildNativeSuite extends AnyFunSuite with BeforeAndAfterAll{ for ((component, _, _, _) <- components) { test(s"Check whether particular keywords can be found in the usage with component $component") { val configFile = getClass.getResource(s"/testns/src/$component/config.vsh.yaml").getPath - val config = Config.read(configFile) + val errStream = new ByteArrayOutputStream() + val config = Console.withErr(errStream) { + Config.read(configFile) + } + val errString = errStream.toString + assert(errString.isEmpty() || errString.matches("Warning: The status of the component 'ns_power' is set to deprecated.\\s*")) val stdout = Exec.run(