You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--list-tests json produces no JSON output when running in --server mode #8661
In server mode (--server dotnettestcli --dotnet-test-pipe <pipe>), --list-tests json emits no JSON output. Both the buffering step and the emission step in TerminalOutputDevice short-circuit when _isServerMode is true.
Background
microsoft/testfx#8280 added the --list-tests json argument and JSON discovery output via TerminalOutputDevice. The .NET SDK (dotnet test) always launches MTP processes with --server dotnettestcli ... so the SDK can read handshake/discovery messages over a named pipe. As a result, the JSON output path is never triggered when using dotnet test --list-tests json.
_discoveredTestsForJson is never populated when running under --server.
DisplayAfterSessionEndRunAsync (around L419):
if(_isServerMode){return;}
The JSON document is never written when running under --server.
Repro
dotnet test --list-tests json
against any MTP test project: no JSON is emitted.
Suggested direction
Allow the JSON buffering + emission paths to run in server mode as well (gated on --list-tests json), or expose the JSON document over the dotnet-test-pipe protocol so the SDK can render it. Some care is needed to avoid double emission when both controller and test host roles run — today the JSON path is restricted to _processRole == TestProcessRole.TestHost (line ~442), which should continue to apply.
This needs to be implemented on SDK side, I think.
SDK shouldn't simply forward the --list-tests json. It should truly handle it. And it might not be that easy, depending on what information you have today in the json. Not all info is available through the pipe protocol.
Activity
Youssef1313 commentedon May 28, 2026
This needs to be implemented on SDK side, I think.
SDK shouldn't simply forward the
--list-tests json. It should truly handle it. And it might not be that easy, depending on what information you have today in the json. Not all info is available through the pipe protocol.See also
testfx/src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/DotnetTestDataConsumer.cs
Line 62 in 255425b
Stream discovered tests to the SDK for --list-tests json under --serv…