Skip to content

Fix PassingNoArguments test: disable --diag to preserve help output#15583

Merged
nohwnd merged 1 commit intomicrosoft:mainfrom
nohwnd:fix/passnoargs-diag
Mar 26, 2026
Merged

Fix PassingNoArguments test: disable --diag to preserve help output#15583
nohwnd merged 1 commit intomicrosoft:mainfrom
nohwnd:fix/passnoargs-diag

Conversation

@nohwnd
Copy link
Copy Markdown
Member

@nohwnd nohwnd commented Mar 26, 2026

#15572 added automatic --diag\ to \InvokeVsTest\ (default \ rue). The \PassingNoArgumentsToVsTestConsoleShouldPrintHelpMessage\ test passes no arguments to vstest.console and checks for help text, but --diag\ changes the output and truncates the help message.

Fix: pass \collectDiagnostics: false\ to preserve the expected output.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

microsoft#15572 added automatic --diag to InvokeVsTest (default true). This test
passes no arguments to vstest.console and checks for help text, but
--diag changes the output, truncating the help message.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 26, 2026 03:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates an acceptance test to avoid automatic --diag invocation so that vstest.console help output remains stable and the “no arguments prints help” assertion passes.

Changes:

  • Disable diagnostics collection in InvokeVsTest for the “no args” help-output test.
  • Add an inline comment explaining why diagnostics are disabled for this scenario.

SetTestEnvironment(_testEnvironment, runnerInfo);

InvokeVsTest(null);
// Don't add --diag, it changes the output and prevents help from showing.
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

The comment conflicts with the PR description: --diag changes the output and truncates/changes the help text, but it doesn’t literally prevent help from showing (the test still asserts help content is present). Update the wording to match the actual failure mode (e.g., ‘changes/truncates the help output’) to avoid misleading future readers.

Suggested change
// Don't add --diag, it changes the output and prevents help from showing.
// Don't add --diag; it changes/truncates the output and would alter the help text this test asserts on.

Copilot uses AI. Check for mistakes.
@nohwnd nohwnd merged commit d3c9644 into microsoft:main Mar 26, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants