@@ -40,7 +40,7 @@ public class VSTestTask2 : ToolTask, ITestTask
4040 public string ? VSTestBlameHangDumpType { get ; set ; }
4141 public string ? VSTestBlameHangTimeout { get ; set ; }
4242 public ITaskItem ? VSTestTraceDataCollectorDirectoryPath { get ; set ; }
43- public bool VSTestNoLogo { get ; set ; }
43+ public bool VSTestNoLogo { get ; set ; } = true ;
4444 public string ? VSTestArtifactsProcessingMode { get ; set ; }
4545 public string ? VSTestSessionCorrelationId { get ; set ; }
4646
@@ -59,7 +59,7 @@ public VSTestTask2()
5959 // Unless user opted out, use UTF encoding, which we force in vstest.console.
6060 _disableUtf8ConsoleEncoding = Environment . GetEnvironmentVariable ( "VSTEST_DISABLE_UTF8_CONSOLE_ENCODING" ) == "1" ;
6161 LogStandardErrorAsError = false ;
62- StandardOutputImportance = "Normal " ;
62+ StandardOutputImportance = "High " ;
6363 }
6464
6565 protected override void LogEventsFromTextOutput ( string singleLine , MessageImportance messageImportance )
@@ -73,14 +73,30 @@ protected override void LogEventsFromTextOutput(string singleLine, MessageImport
7373 {
7474 // Forward the output we receive as messages.
7575 case "output-info" :
76- Log . LogMessage ( MessageImportance . Low , data [ 0 ] ) ;
76+ if ( data [ 0 ] != null )
77+ {
78+ LogMSBuildOutputMessage ( data [ 0 ] ! ) ;
79+ }
7780 break ;
7881 case "output-warning" :
7982 Log . LogWarning ( data [ 0 ] ) ;
8083 break ;
8184 case "output-error" :
82- Log . LogError ( data [ 0 ] ) ;
83- break ;
85+ {
86+ var error = data [ 0 ] ;
87+ if ( error != null && error . StartsWith ( "[xUnit.net" , StringComparison . OrdinalIgnoreCase ) )
88+ {
89+ // Downgrade errors from xunit, because they will end up being duplicated on screen with assertion errors.
90+ // And we end up with more errors in summary which is hard to figure out for users.
91+ LogMSBuildOutputMessage ( error ) ;
92+ }
93+ else
94+ {
95+ Log . LogError ( data [ 0 ] ) ;
96+ }
97+
98+ break ;
99+ }
84100
85101 case "run-cancel" :
86102 case "run-abort" :
@@ -210,14 +226,17 @@ protected override void LogEventsFromTextOutput(string singleLine, MessageImport
210226 // DO NOT call the base, it parses out the output, and if it sees "error" in any place it will log it as error
211227 // we don't want this, we only want to log errors from the text messages we receive that start error splitter.
212228 // base.LogEventsFromTextOutput(singleLine, messageImportance);
213-
214- if ( ! StringUtils . IsNullOrWhiteSpace ( singleLine ) )
215- {
216- Log . LogMessage ( MessageImportance . Low , singleLine ) ;
217- }
229+ LogMSBuildOutputMessage ( singleLine ) ;
218230 }
219231 }
220232
233+ private void LogMSBuildOutputMessage ( string singleLine )
234+ {
235+
236+ var message = new ExtendedBuildMessageEventArgs ( "TLTESTOUTPUT" , singleLine , null , null , MessageImportance . High ) ;
237+ BuildEngine . LogMessageEvent ( message ) ;
238+ }
239+
221240 private bool TryGetMessage ( string singleLine , out string name , out string ? [ ] data )
222241 {
223242 if ( singleLine . StartsWith ( _messageSplitter ) )
0 commit comments