Skip to content

Avoid plugging in TerminalOutputDevice when running with pipe protocol#7564

Draft
Youssef1313 wants to merge 2 commits intomainfrom
dev/ygerges/avoid-terminal-outputdevice
Draft

Avoid plugging in TerminalOutputDevice when running with pipe protocol#7564
Youssef1313 wants to merge 2 commits intomainfrom
dev/ygerges/avoid-terminal-outputdevice

Conversation

@Youssef1313
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings March 16, 2026 16:50
@Youssef1313 Youssef1313 marked this pull request as draft March 16, 2026 16:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the dotnet-test pipe protocol integration so the platform can avoid wiring the default terminal output device, aiming to prevent MTP output from interfering with dotnet test live output.

Changes:

  • Expand pipe-protocol supported versions to include 1.0.1 and advertise them during handshake.
  • Allow ProxyOutputDevice/PlatformOutputDeviceManager to operate without a terminal output device when running under pipe protocol.
  • Adjust TestHostBuilder protocol detection to decide when pipe protocol is active and influence output-device construction.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/Constants.cs Replaces single protocol version with a semicolon-delimited supported-versions list and documents 1.0.1.
src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/DotnetTestConnection.cs Sends supported versions during handshake using the new constants.
src/Platform/Microsoft.Testing.Platform/OutputDevice/ProxyOutputDevice.cs Makes the wrapped platform output device nullable and guards calls accordingly.
src/Platform/Microsoft.Testing.Platform/OutputDevice/OutputDeviceManager.cs Suppresses creation of the default terminal output device for pipe protocol (currently by returning null).
src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.cs Detects jsonrpc vs pipe protocol and passes protocol info into output-device construction.

You can also share your feedback on Copilot code review. Take the survey.

@Youssef1313 Youssef1313 force-pushed the dev/ygerges/avoid-terminal-outputdevice branch from 3e0b7be to e1a5220 Compare March 16, 2026 18:23
Copilot AI review requested due to automatic review settings March 16, 2026 18:28
@Youssef1313 Youssef1313 force-pushed the dev/ygerges/avoid-terminal-outputdevice branch from e8089ff to 52d6ce1 Compare March 16, 2026 18:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Microsoft.Testing.Platform’s output-device wiring so that when running under the dotnet-test pipe protocol, the default TerminalOutputDevice is not installed (avoiding interference with SDK live output), while keeping the rest of the host/service construction flow intact.

Changes:

  • Make the platform output device optional (nullable) and guard call sites accordingly.
  • Introduce pipe-protocol detection and skip creating the default terminal output device in that mode.
  • Expand dotnet-test IPC protocol constants to advertise multiple supported versions.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Platform/Microsoft.Testing.Platform/Services/ServiceProviderExtensions.cs Makes GetPlatformOutputDevice nullable (non-required service).
src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/Constants.cs Replaces single protocol version constant with a supported-versions list and adds explanatory comments.
src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/DotnetTestConnection.cs Sends supported protocol versions during handshake.
src/Platform/Microsoft.Testing.Platform/OutputDevice/ProxyOutputDevice.cs Allows OriginalOutputDevice to be null and guards dispatch calls.
src/Platform/Microsoft.Testing.Platform/OutputDevice/OutputDeviceManager.cs Skips default terminal output device creation when in pipe protocol.
src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.cs Detects pipe protocol; avoids registering/initializing a terminal output device in that scenario.
src/Platform/Microsoft.Testing.Platform/Hosts/TestFrameworkBuilderData.cs Allows PlatformOutputDisplayService to be null.

You can also share your feedback on Copilot code review. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants