Unit Test Runner does not show console output


Rider does not output any logs in the Unit Test window. When I run the tests using the CLI it does output logs. I run rider on an M1 Mac.

Output in Rider (empty):

While running it in the CLI confirms there is actually output:

dotnet test --filter "FullyQualifiedName~CreateDispatch_ShouldCreateDispatch_ForMinimumFieldsSupplied"

<text removed for privacy reasons>

Starting test execution, please wait...
warn: Microsoft.EntityFrameworkCore.Model.Validation[10400]
Sensitive data logging is enabled. Log entries and exception messages may include sensitive application data; this mode should only be enabled during development.
info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
Entity Framework Core 6.0.7 initialized 'WriteDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL:6.0.5+9d79af6e2586d5d28da253ac075706a5575a1743' with options: SensitiveDataLoggingEnabled DetailedErrorsEnabled
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
Executed DbCommand (38ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid=c.relnamespace WHERE c.relname='__EFMigrationsHistory');
info: Microsoft.EntityFrameworkCore.Database.Command[20101]

Am I missing a setting to show the logs? 

Comment actions Permalink

Hello Jorikvdwerf,

Could you please clarify the way the test output is produced? A sample code snippet would be perfect =)

Comment actions Permalink

I am having the same problem. When I run an NUnit test one by one, right-clicking it and select `Run Unit Test` or `Debug Unit Test`, I see the output from `Console.WriteLine("testing")`, when clicking on the individual test that have run. But when I run all tests on a class, I see no output in the console.

This makes it very hard to debug the test itself using plain std-out prints to the console (Console.WriteLine()).

I tried with TestContext.Out.WriteLine() as well, but it game no output as well.

When I run all the tests in a class from a command prompt with with the `dotnet test` command, I do see all my output. So I am just missing them inside Rider.

Comment actions Permalink
Thank you for the input. Unfortunately, I could not reproduce the behaviour either in Windows or MacOS with M1 chip. Would you please check if the issue is specific to a particular solution? If so, what is the target framework, unit test framework and how many tests there are?
Shall it reproduce in some dummy solution, will be happy if you could share it. Thank you!

Please sign in to leave a comment.