From ced3d2f1fef4bcbff80f5e92d32f3b44b3186993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Thu, 29 Aug 2024 10:38:15 +0200 Subject: [PATCH] Forward error output from testhost as info --- .../Hosting/TestHostManagerCallbacks.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/TestHostManagerCallbacks.cs b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/TestHostManagerCallbacks.cs index 9709607005..645db3c0a2 100644 --- a/src/Microsoft.TestPlatform.TestHostProvider/Hosting/TestHostManagerCallbacks.cs +++ b/src/Microsoft.TestPlatform.TestHostProvider/Hosting/TestHostManagerCallbacks.cs @@ -58,7 +58,9 @@ public void ErrorReceivedCallback(StringBuilder testHostProcessStdError, string? testHostProcessStdError.AppendSafeWithNewLine(data); if (_forwardOutput && _messageLogger != null && !StringUtils.IsNullOrWhiteSpace(data)) { - _messageLogger.SendMessage(TestMessageLevel.Error, data); + // Forward the error output, but DO NOT forward it as error. Until now it was only written into logs, + // and applications love to write Debug messages into error stream. Which we do not want to fail the test run. + _messageLogger.SendMessage(TestMessageLevel.Informational, data); } }