testfx icon indicating copy to clipboard operation
testfx copied to clipboard

[MTP] Cannot switch off terminal logger when building during `dotnet test`

Open cbersch opened this issue 2 months ago • 6 comments

I would like to switch off the interactive terminal logger when building during dotnet test, but --tl:off isn't supported:

dotnet test --project MyProject.csproj --tl:off
bin\Debug\net10.0\MyProject.dll (net10.0) Zero tests ran
Exit code: 5
  Standard output: Microsoft.Testing.Platform v1.9.0+e64ddb3203 (UTC 10/01/2025) [win-x64 - net10.0]
  Unknown option '--tl'
  Usage MyProject.exe [option providers] [extension option providers]

cbersch avatar Oct 22 '25 10:10 cbersch

MTP is not using the terminal logger functionality of dotnet SDK. If you are referring to showing the progress, you can disable it with --no-progress

Evangelink avatar Oct 28 '25 15:10 Evangelink

MTP is not using the terminal logger functionality of dotnet SDK.

I know.

If you are referring to showing the progress, you can disable it with --no-progress

I mean the output during building, which is probably triggered implicitly, before the actual test run starts when calling dotnet test.

And this cannot be switched off to be non-interactive. Tomorrow I can add a picture

cbersch avatar Oct 28 '25 16:10 cbersch

@nohwnd @Youssef1313 could you have a quick look at this?

Evangelink avatar Oct 29 '25 08:10 Evangelink

There is no --tl, but there is -tl:off. It might have an impact on the output, but I never looked closely at what exactly it affects.

@nohwnd @mariam-abdulla Do you know?

Youssef1313 avatar Oct 29 '25 09:10 Youssef1313

As you observed -tl is not passed to msbuild, you can use MSBUILDTERMINALLOGGER="false" env variable to get the same effect as --tl:off

nohwnd avatar Oct 30 '25 11:10 nohwnd

@nohwnd Thanks, that works.

cbersch avatar Oct 30 '25 11:10 cbersch

Moving the issue over to https://github.com/dotnet/sdk/issues/52229

Evangelink avatar Dec 17 '25 11:12 Evangelink