Skip to content

Backport MTP handshake failure diagnostics#55377

Open
Evangelink wants to merge 2 commits into
dotnet:release/10.0.1xxfrom
Evangelink:dev/amauryleve/backport-mtp-handshake-diagnostics
Open

Backport MTP handshake failure diagnostics#55377
Evangelink wants to merge 2 commits into
dotnet:release/10.0.1xxfrom
Evangelink:dev/amauryleve/backport-mtp-handshake-diagnostics

Conversation

@Evangelink

Copy link
Copy Markdown
Member

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 test now:

  • surfaces the already-captured child stdout and stderr
  • reports the overall summary as Failed! instead of Zero tests ran
  • reprints actionable handshake failures after the summary so they remain visible at the end of verbose runs

This is the diagnostic companion/backport for #55309. It is intentionally distinct from #55376, which maps --nologo to MTP's --no-banner on main.

The new recap heading is localized through the normal generated XLF workflow.

Validation

  • GivenDotnetTestRunsConsoleAppWithoutHandshake: 3 passed
  • focused unsupported-option regression verifies stdout, stderr, exit code 5, failed summary, and end-of-run recap

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 <223556219+Copilot@users.noreply.github.com>

Copilot-Session: fca5f32b-6c6e-4767-a336-248686d7d8ad
Copilot AI review requested due to automatic review settings July 20, 2026 13:21
@azure-pipelines

Copy link
Copy Markdown
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 misleading Zero 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

Comment thread src/Cli/dotnet/Commands/CliCommandStrings.resx Outdated
Comment thread src/Cli/dotnet/Commands/Test/MTP/Terminal/TerminalTestReporter.cs
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 <223556219+Copilot@users.noreply.github.com>

Copilot-Session: fca5f32b-6c6e-4767-a336-248686d7d8ad
@Evangelink

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants