-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log messages for Test Results #75084
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
messageBuilder.AppendLine(IndentString($"{LanguageServerResources.Message}:", 4)); | ||
messageBuilder.AppendLine(IndentString(result.ErrorMessage, 8)); | ||
} | ||
|
||
if (!string.IsNullOrWhiteSpace(result.ErrorStackTrace)) | ||
{ | ||
messageBuilder.AppendLine(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will append an empty line between the msg and stack trace, which IIRC is why I appended only once above. Maybe not the biggest issue but I believe that was why it was written that way
messageBuilder.AppendLine(value: IndentString($"{LanguageServerResources.Stack_Trace}:", 4)); | ||
messageBuilder.AppendLine(IndentString(result.ErrorStackTrace, 8)); | ||
} | ||
|
||
var standardOutputMessages = GetTestMessages(result.Messages, TestResultMessage.StandardOutCategory); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you have a screenshot of what it looks like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the description with some output. Let me see if I can get output and error messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok. So just one new line at the top and we squish everything together.
Starting test run
[Failed] Microsoft.CodeAnalysis.Tools.Tests.Analyzers.ThirdPartyAnalyzerFormatterTests.TestLoadingAllAnalyzers_LoadsDependenciesFromAllSearchPaths
Message:
System.Exception : This is an error message
Stack Trace:
at Microsoft.CodeAnalysis.Tools.Tests.Analyzers.ThirdPartyAnalyzerFormatterTests.TestLoadingAllAnalyzers_LoadsDependenciesFromAllSearchPaths() in c:\Users\jorobich\source\format\tests\Analyzers\ThirdPartyAnalyzerFormatterTests.cs:line 218
--- End of stack trace from previous location ---
Standard Output Messages:
Determining projects to restore...
All projects are up-to-date for restore.
==== Summary ====
Failed! - Failed: 1, Passed: 0, Skipped: 0, Total: 1, Duration: 9s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
This updates our logging to match the console logger from the vstest.console runner. See https://github.com/Evangelink/vstest/blob/85ae981180b515d79721266a19a7aa31c30828c5/src/vstest.console/Internal/ConsoleLogger.cs#L295
Resolves http://github.com/dotnet/vscode-csharp/issues/6221
Output looks like: