Skip to content
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

Console logger support during test execution #3746

Open
MarcoK80 opened this issue Sep 2, 2024 · 2 comments
Open

Console logger support during test execution #3746

MarcoK80 opened this issue Sep 2, 2024 · 2 comments

Comments

@MarcoK80
Copy link

MarcoK80 commented Sep 2, 2024

We use a console and file logger during test execution. The console is not redirected to the Test execution during the test run. This should be configurable so if you run the test e.g. on a hosted agent that the test execution itself is always having the console log output in a continues flow.

E.g.

Test is having the simple Console loggerprovider. This is displayed after test run in Visual studio

image

In Azure pipeline this is hidden:

image

Background and Motivation

This would help detecting issues e.g. when the agent cancels or in the scenario when a time out occurs and you want to see which test and test step was executed. The console log should be displayed during test execution and not after.
The option to store the log in a file is not useful if the agent gets shutdown or crashed.

Example: We are trying to analyse a test run that crashes / shutdown the agent. There is no way to diagnose what happened:

image

Proposed Feature

Redirect console output in flow of the test run and always show it. This should be based on configuration.

@MarcoRossignoli
Copy link
Contributor

@MarcoRossignoli
Copy link
Contributor

MarcoRossignoli commented Sep 2, 2024

We are trying to analyse a test run that crashes / shutdown the agent. There is no way to diagnose what happened:

You can enable crash dump extension https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-platform-extensions-diagnostics#crash-dump

If you're using MSTest.Sdk it's enough to add the msbuild property <EnableMicrosoftTestingExtensionsCrashDump>true</EnableMicrosoftTestingExtensionsCrashDump> to opt-in the extension and after you can pass the command line like in the documentation https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-mstest-sdk#enable-or-disable-extensions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants