Repository navigation
Refactor TrxReportGeneratorCommandLine to extend ReportGeneratorCommandLineBase - #9185
Merged
Amaury Levé (Evangelink) merged 3 commits intoJun 17, 2026
Conversation
Move the TESTINGPLATFORM_CONSOLEOUTPUTDEVICE_SKIP_BANNER constant and the banner text construction (StringBuilder-based platform info formatting) into a new shared static helper class OutputDeviceBannerHelper. Both SimplifiedConsoleOutputDeviceBase and TerminalOutputDevice now delegate to OutputDeviceBannerHelper.BuildBannerText() and reference the shared constant, eliminating ~30 lines of duplicated code. Fixes #9170 Co-authored-by: Copilot <[email protected]>
…ndLineBase Remove duplicated validation logic from TrxReportGeneratorCommandLine by having it extend ReportGeneratorCommandLineBase (like CTRF, HTML, and JUnit already do). This ensures future validation improvements automatically apply to TRX reports. Fixes #9169 Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the TRX report generator’s command-line provider to reuse the shared ReportGeneratorCommandLineBase validation pattern used by the other report generators, reducing duplicated option/argument validation logic. The PR also includes an (unrelated) refactor that centralizes console banner text construction and the “skip banner” env-var name into a new helper.
Changes:
- Update
TrxReportGeneratorCommandLineto inherit fromReportGeneratorCommandLineBaseand remove local validation overrides. - Link
ReportGeneratorCommandLineBase.csinto the TRX report extension project to align with CTRF/HTML/JUnit extensions. - Extract banner construction / skip-banner env-var constant into
OutputDeviceBannerHelperand update output-device call sites to use it.
Show a summary per file
| File | Description |
|---|---|
| src/Platform/Microsoft.Testing.Platform/OutputDevice/TerminalOutputDevice.cs | Switches banner skip env-var usage and banner text building to OutputDeviceBannerHelper. |
| src/Platform/Microsoft.Testing.Platform/OutputDevice/SimplifiedConsoleOutputDeviceBase.cs | Same banner/env-var refactor as TerminalOutputDevice. |
| src/Platform/Microsoft.Testing.Platform/OutputDevice/OutputDeviceBannerHelper.cs | New helper centralizing banner text construction and env-var constant. |
| src/Platform/Microsoft.Testing.Extensions.TrxReport/TrxCommandLine.cs | Moves TRX CLI provider to ReportGeneratorCommandLineBase and supplies its parameters/resources. |
| src/Platform/Microsoft.Testing.Extensions.TrxReport/Microsoft.Testing.Extensions.TrxReport.csproj | Links ReportGeneratorCommandLineBase.cs from SharedExtensionHelpers. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 2
Petr Pokorny (0101)
approved these changes
Jun 16, 2026
Petr Pokorny (0101)
approved these changes
Jun 17, 2026
Petr Pokorny (0101)
left a comment
Member
There was a problem hiding this comment.
Automated safety check passed: no dangerous changes detected (no secrets, exfiltration, destructive ops, or suspicious dependencies). Approving as requested. Note: this is a quick safety sanity check, not a full code review.
…9169-trx-extend-base-class # Conflicts: # src/Platform/Microsoft.Testing.Platform/OutputDevice/OutputDeviceBannerHelper.cs
Amaury Levé (Evangelink)
enabled auto-merge (squash)
June 17, 2026 09:41
Amaury Levé (Evangelink)
deleted the
dev/amauryleve/issue-9169-trx-extend-base-class
branch
June 17, 2026 10:34
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.
Summary
Refactors \TrxReportGeneratorCommandLine\ to extend \ReportGeneratorCommandLineBase\ instead of \CommandLineOptionsProviderBase, aligning it with the three other report generators (CTRF, HTML, JUnit) that already use this pattern.
Changes
Validation
Fixes #9169