Skip to content

Conversation

@bartekwasielak
Copy link
Contributor

Copied the content of NServiceBus base test class to add the TearDown method printing out the dump of the context.

Comment on lines +59 to +69
if (TestExecutionContext.CurrentContext.CurrentResult.ResultState == ResultState.Failure || TestExecutionContext.CurrentContext.CurrentResult.ResultState == ResultState.Error)
{
TestContext.Out.WriteLine(string.Empty);
TestContext.Out.WriteLine($"Log entries (log level: {scenarioContext.LogLevel}):");
TestContext.Out.WriteLine("--- Start log entries ---------------------------------------------------");
foreach (var logEntry in scenarioContext.Logs)
{
TestContext.Out.WriteLine($"{logEntry.Timestamp:T} {logEntry.Level} {logEntry.Endpoint ?? TestContext.CurrentContext.Test.Name}: {logEntry.Message}");
}
TestContext.Out.WriteLine("--- End log entries ---------------------------------------------------");
}
Copy link
Member

Choose a reason for hiding this comment

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

Given that SC seems to have its own mechanism of printing logs, I think we can remove this part (as first imperfect step towards better debugging ability)

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.

2 participants