Repository navigation
Backport MTP handshake failure diagnostics - #55377
Evangelink merged 4 commits into
Conversation
Surface captured test host output when an MTP application exits before handshake, mark the run failed, and recap actionable failures after the summary. Add regression coverage for an unsupported forwarded option. Co-authored-by: Copilot App <[email protected]> Copilot-Session: fca5f32b-6c6e-4767-a336-248686d7d8ad
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Backports improved Microsoft.Testing.Platform (MTP) handshake-failure diagnostics into release/10.0.1xx so dotnet test surfaces pre-handshake failures more clearly (captured stdout/stderr, correct “Failed!” headline, and an end-of-run recap).
Changes:
- Track handshake-failure details during the run and re-print a “Handshake failures:” recap after the test-run summary.
- Adjust summary headline selection so handshake failures produce
Failed!instead of a misleadingZero tests ran. - Add/extend regression coverage for invalid-option pre-handshake failures and localize the recap header.
Show a summary per file
| File | Description |
|---|---|
| test/dotnet.Tests/CommandTests/Test/GivenDotnetTestRunsConsoleAppWithoutHandshake.cs | Adds regression asserting stdout/stderr surfacing, failed summary headline, and end-of-run recap for pre-handshake failures. |
| src/Cli/dotnet/Commands/Test/MTP/Terminal/TerminalTestReporter.cs | Tracks handshake failures and appends a recap after the run summary; updates summary precedence. |
| src/Cli/dotnet/Commands/CliCommandStrings.resx | Adds localized resource string for the “Handshake failures:” recap header. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.cs.xlf | Adds new trans-unit for the recap header localization. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.de.xlf | Adds new trans-unit for the recap header localization. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.es.xlf | Adds new trans-unit for the recap header localization. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.fr.xlf | Adds new trans-unit for the recap header localization. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.it.xlf | Adds new trans-unit for the recap header localization. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.ja.xlf | Adds new trans-unit for the recap header localization. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.ko.xlf | Adds new trans-unit for the recap header localization. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.pl.xlf | Adds new trans-unit for the recap header localization. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.pt-BR.xlf | Adds new trans-unit for the recap header localization. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.ru.xlf | Adds new trans-unit for the recap header localization. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.tr.xlf | Adds new trans-unit for the recap header localization. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hans.xlf | Adds new trans-unit for the recap header localization. |
| src/Cli/dotnet/Commands/xlf/CliCommandStrings.zh-Hant.xlf | Adds new trans-unit for the recap header localization. |
Copilot's findings
- Files reviewed: 16/16 changed files
- Comments generated: 3
Use localized resources in the regression assertions, normalize control characters in captured host output, and correct the generated localization note. Co-authored-by: Copilot App <[email protected]> Copilot-Session: fca5f32b-6c6e-4767-a336-248686d7d8ad
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. |
…shake-diagnostics
Use ConcurrentQueue to retain handshake failures without a separate lock and counter. Co-authored-by: Copilot App <[email protected]>
This comment has been minimized.
This comment has been minimized.
🔍 Build Failure AnalysisSummary — The build itself did not fail due to a code problem in this PR: 21 of 24 build legs (all Root cause 1: Network flake downloading bundled components (
|
| Leg | Result |
|---|---|
10_0, 10_2_FullFramework_windows_x64 |
✅ 0 errors |
10_1_FullFramework_windows_x64 |
dotnet-watch.Tests.dll.1) — out of scope |
2_0, 2_1_TestBuild_linux_arm64 |
✅ 0 errors |
3_0, 3_1_TestAsTools_windows_x64 |
✅ 0 errors |
4_0_AoT_macOS_x64 |
❌ Network flake (DownloadBundledComponents) |
4_1_AoT_macOS_x64 |
✅ 0 errors |
5_0–5_2_TestBuild_macOS_arm64 |
✅ 0 errors |
6_0–6_2_TestBuild_windows_x64 |
✅ 0 errors |
7_0–7_2_TestBuild_macOS_x64 |
✅ 0 errors |
8_0–8_2_AoT_windows_x64 |
✅ 0 errors |
9_0_TestBuild_linux_x64 |
dotnet-watch.Tests.dll.1) — out of scope |
9_1, 9_2_TestBuild_linux_x64 |
✅ 0 errors |
🤖 Generated by the Build Failure Analysis workflow using (a href="(dev.azure.com/redacted) · commit 11a1073
🤖 Automated content by GitHub Copilot. Generated by the Build Failure Analysis workflow. · auto · 107.7 AIC · ⌖ 1.97 AIC · ⊞ 7.2K · [◷]( · ◷)
Summary
Backports the minimal Microsoft.Testing.Platform handshake diagnostics from #54501 to
release/10.0.1xx.When an unmatched option is forwarded to an MTP test application and the application exits before the handshake (for example with
InvalidCommandLine/ exit code 5),dotnet testnow:Failed!instead ofZero tests ranThis is the diagnostic companion/backport for #55309. It is intentionally distinct from #55376, which maps
--nologoto MTP's--no-banneronmain.The new recap heading is localized through the normal generated XLF workflow.
Validation
GivenDotnetTestRunsConsoleAppWithoutHandshake: 3 passed