Cleanup terminal reporter exception flattening by removing FlatException DTO#8212
Closed
Copilot wants to merge 2 commits into
Closed
Cleanup terminal reporter exception flattening by removing FlatException DTO#8212Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Cleanup terminal test reporter for optimizations
Cleanup terminal reporter exception flattening by removing FlatException DTO
May 14, 2026
Member
|
It doesn't seem to be simplifying code, I'd say the opposite so closing |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the terminal reporter’s FlatException DTO and standardizes flattened exception data as a named tuple array (ErrorMessage, ErrorType, StackTrace) across terminal rendering, dotnet-test IPC conversion, and the associated unit tests.
Changes:
- Updated
ExceptionFlattener.Flatten(...)to return an array of named tuples instead ofFlatException[]. - Updated terminal reporter formatting + test completion paths to consume the tuple shape directly.
- Updated dotnet-test IPC exception mapping and unit tests to use the new flattened exception shape.
Show a summary per file
| File | Description |
|---|---|
| test/UnitTests/Microsoft.Testing.Platform.UnitTests/OutputDevice/Terminal/TerminalTestReporterTests.cs | Updates tests to assert against tuple-shaped flattened exceptions. |
| src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/DotnetTestDataConsumer.cs | Adapts IPC exception mapping to consume the tuple-shaped flattening output. |
| src/Platform/Microsoft.Testing.Platform/OutputDevice/Terminal/TerminalTestReporter.TestCompletion.cs | Threads tuple-shaped flattened exceptions through test completion/rendering pipeline. |
| src/Platform/Microsoft.Testing.Platform/OutputDevice/Terminal/TerminalTestReporter.Formatting.cs | Updates formatting helpers to accept and read tuple-shaped flattened exception data. |
| src/Platform/Microsoft.Testing.Platform/OutputDevice/Terminal/ExceptionFlattener.cs | Removes FlatException record and emits named tuples directly from Flatten(...). |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 0
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.
✨ Enhancement
The terminal reporter still carried a local
FlatExceptionwrapper that added indirection without adding behavior. This change simplifies exception shaping by removing that type and using a single shared value shape end-to-end.What does this improve?
FlatExceptionrecord from the exception flattening path.ErrorMessage,ErrorType,StackTrace) across terminal rendering and dotnet-test IPC conversion.Why is this valuable?
Implementation approach:
ExceptionFlattener.Flatten(...)to return:FlatExceptionand updated all consumers:FormatErrorMessage,FormatStackTrace, inner exception formatting)Example (new shape):