Skip to content

Return the stdout messages to improve test logging#1203

Merged
DustinCampbell merged 7 commits intoOmniSharp:masterfrom
akshita31:stdout_message
May 29, 2018
Merged

Return the stdout messages to improve test logging#1203
DustinCampbell merged 7 commits intoOmniSharp:masterfrom
akshita31:stdout_message

Conversation

@akshita31
Copy link
Copy Markdown
Contributor

@akshita31 akshita31 commented May 24, 2018

dotnet test also prints the stdout messages. So added a property to DotNetTestResult to return an array of these messages.

omnisharp-vscode side : dotnet/vscode-csharp#2343

Please review : @rchande @DustinCampbell

ErrorStackTrace = testResult.ErrorStackTrace
ErrorStackTrace = testResult.ErrorStackTrace,
StdOutMessages = testResult.Messages
.Where(message => message.Category == TestResultMessage.StandardOutCategory)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be picking up standard error here too?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And keeping it in its own category

public string Outcome { get; set; }
public string ErrorMessage { get; set; }
public string ErrorStackTrace { get; set; }
public string[] StdOutMessages {get; set; }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StandardOutput

public string ErrorMessage { get; set; }
public string ErrorStackTrace { get; set; }
public string[] StdOutMessages {get; set; }
public string[] StandardOutputMessages { get; set; }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StandardOutput (no "messages")

Outcome = testResult.Outcome.ToString().ToLowerInvariant(),
ErrorMessage = testResult.ErrorMessage,
ErrorStackTrace = testResult.ErrorStackTrace
ErrorStackTrace = testResult.ErrorStackTrace,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to unit test this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Copy Markdown
Contributor

@DustinCampbell DustinCampbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@DustinCampbell DustinCampbell merged commit 3f1d6c8 into OmniSharp:master May 29, 2018
@akshita31 akshita31 deleted the stdout_message branch May 29, 2018 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants