TestingPlatformCaptureOutput=false does not work with .NET 9.0 SDK
Describe the bug
When running dotnet test -p:TestingPlatformCaptureOutput=false the output of the testing platform is not visible anymore with .NET 9.0 SDK.
Steps To Reproduce
- Create a new xUnit v3 project (e.g. https://xunit.net/docs/getting-started/v3/cmdline#create-the-unit-test-project)
- Uncomment
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>in the csproj - Run
dotnet test -p:TestingPlatformCaptureOutput=false
Expected behavior
Output using .NET 8.0 SDK (8.0.404)
dotnet test -p:TestingPlatformCaptureOutput=false
Run tests: 'MyFirstUnitTests\bin\Debug\net8.0\MyFirstUnitTests.dll' [net8.0|x64]
xUnit.net v3 Microsoft.Testing.Platform Runner v1.0.0+5b41c61aa1 (64-bit .NET 8.0.11)
Passed! - Failed: 0, Passed: 1, Skipped: 0, Total: 1, Duration: 433ms
Testlaufzusammenfassung: Bestanden! - MyFirstUnitTests\bin\Debug\net8.0\MyFirstUnitTests.dll (net8.0|x64)
total: 1
failed: 0
succeeded: 1
skipped: 0
duration: 569ms
Tests succeeded: 'MyFirstUnitTests\bin\Debug\net8.0\MyFirstUnitTests.dll' [net8.0|x64]
Actual behavior
Output using .NET 9.0 SDK (9.0.101)
dotnet test -p:TestingPlatformCaptureOutput=false
MyFirstUnitTests Test Erfolgreich (1,6s)
Testzusammenfassung: insgesamt: 1; fehlgeschlagen: 0; erfolgreich: 1; übersprungen: 0; Dauer: 1,4 Sek.
Erstellen von Erfolgreich in 3,7s
Additional context
See also: https://github.com/xunit/xunit/issues/3092#issuecomment-2556234421
Documentation: https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-integration-dotnet-test#show-complete-platform-output
Hi @campersau,
Thanks for raising this issue. I can confirm that terminal logger of .NET 9 is breaking MTP experience... I'll raise the point with SDK team. In the meantime, you can use /tl:false to disable the terminal logger experience.
Another potential solution is dotnet test --verbosity detailed. We are also shipping new dotnet test experience for MTP in .NET 10 SDK.
@Youssef1313 @nohwnd do you want to fix the experience for before net10 or not?
I think this is fundamental problem of terminal logger that we reported to msbuild and there was no consensus on how to handle it. (Cannot find the original issue but here is similar: https://github.com/dotnet/sdk/issues/43293 ) Not all info is shown, e.g. interesting information from dotnet publish, or additional info from dotnet build. So I would rather not make a one-off solution to fix it ourselves.
@nohwnd Should we close as "External" (SDK) then?