Merged
Conversation
5eb4a9c to
e66796d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the platform’s terminal output device to rely on the test process role (TestHost/Controller/Orchestrator) rather than ITestSessionLifetimeHandler callbacks for certain behaviors, and updates the Playground sample to always enable TRX reporting.
Changes:
- Remove
ITestSessionLifetimeHandlerimplementation fromTerminalOutputDeviceand switch logic to useTestProcessRole. - Track process role via
HandleProcessRoleAsyncand use it to decide when to complete the run and how to classify artifacts as out-of-process. - Enable TRX reporting by default in the Playground sample and add the required project reference.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Platform/Microsoft.Testing.Platform/OutputDevice/TerminalOutputDevice.cs | Replace session-lifetime-handler-based state with role-based state for end-of-run and artifact classification. |
| samples/Playground/Program.cs | Enable TRX provider in the sample by default. |
| samples/Playground/Playground.csproj | Add TRX report extension project reference needed by the sample. |
You can also share your feedback on Copilot code review. Take the survey.
src/Platform/Microsoft.Testing.Platform/OutputDevice/TerminalOutputDevice.cs
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Platform/OutputDevice/TerminalOutputDevice.cs
Show resolved
Hide resolved
src/Platform/Microsoft.Testing.Platform/OutputDevice/TerminalOutputDevice.cs
Show resolved
Hide resolved
Evangelink
approved these changes
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
_firstCallTo_OnSessionStartingAsyncfield is not very trivial to understand at a first glance. So refactoring this out. How it used to work is:OnTestSessionStartingAsync(this called ONLY in the testhost).Now that we have already HandleProcessRole, I'm using that to directly store the role of the current process.
This also means we no longer need any logic in
OnTestSessionStartingAsyncand we don't need to implementITestSessionLifetimeHandler.