dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.96k stars 4.65k forks source link

Update instructions for running Console ManualTests #100274

Open tmds opened 5 months ago

tmds commented 5 months ago

There are some instructions on how to run the Console manual tests: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Console/tests/ManualTests/Readme.md

In the past, I've successfully used these instructions to run the tests. It seems this is no longer working.

export MANUAL_TESTS=true
dotnet test

blocks without showing test output.

The change in behavior is possibly due to changes in msbuild for the terminal logger and/or related changes in vstest.

cc @dotnet/area-system-console @baronfel @rainersigwald

dotnet-policy-service[bot] commented 5 months ago

Tagging subscribers to this area: @dotnet/area-system-console See info in area-owners.md if you want to be subscribed.

rainersigwald commented 5 months ago

@nohwnd this sounds like one you'll be interested in.

@tmds have you tried with VSTestUseMSBuildOutput=false dotnet test? I think that might disable the change that's causing you trouble.

tmds commented 5 months ago

have you tried with VSTestUseMSBuildOutput=false dotnet test? I think that might disable the change that's causing you trouble.

This doesn't seem to make a difference.

When I run as dotnet build -t:test the output is showing, but it still behaves unexpected. For example, the test should print:

System.Text.ConsoleEncoding
'ΠΣ'.
Did you see Pi and Sigma or question marks? [y/n]

But the last line is not printed until I press a key.

The last line is different from the previous line as it uses Console.Write instead of Console.WriteLine. There may be some line buffer that is not printing this line until it sees the end of the line char.

nohwnd commented 5 months ago

Looking at global.json net9-preview1 is used, dotnet test integration with terminal logger is super basic there. It is better in preview2, but similarly to other build workloads, console.write/writeline might not propagate to console.

The new dotnet test experience can be disabled by this env variable: MSBUILDENSURESTDOUTFORTASKPROCESSES=1 or by -p:VSTestUseMSBuildOutput=false on command line.

jozkee commented 4 months ago

Reopening to track question https://github.com/dotnet/runtime/pull/100333#discussion_r1578263569.