Skip to content

test: keep the last argument out of the test-integration.bat help block - #345947

Merged
Aaron Munger (amunger) merged 1 commit into
mainfrom
copilot/vscode/test-integration-bat-script-name
Nov 4, 2026
Merged

Aaron Munger (amunger) merged 1 commit into
mainfrom
copilot/vscode/test-integration-bat-script-name

Conversation

@bryanchen-d

@bryanchen-d Bryan Chen (bryanchen-d) commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes the Windows x64 Agent Host E2E failure in main CI since #345871, first seen in 492607. All 8 two-process suites exit 255 right away with full was unexpected at this time., and the single-process suites run normally.

Cause: scripts\test-integration.bat parses its arguments with shift, which shifts %0 too, so after the loop %~nx0 is the last argument. In ADO the Agent Host E2E runner appends the suite label and profile to --tfs, so for the new two-process suites the last argument is Integration Tests Copilot (1/2) full, and %~nx0 becomes 2) full. cmd parses the if defined SHOW_HELP ( ... ) block even when it doesn't run it, so echo Usage: 2) full [options] ends the block at that ). GitHub PR CI doesn't pass --tfs, so it never hit this.

Fix: save %~nx0 in SCRIPT_NAME before parsing, the same way SCRIPT_DIR already is, and use it in the help text. This also corrects --help, which used to print Usage: --help [options].

Validation:

  • I ran the real script through the runner's child.ps1 launch path with test.bat and node stubbed, using CI's argument order (--run … --testShard 1/2 --build --tfs "Integration Tests Copilot (1/2) full"). Before the fix: full was unexpected at this time., exit 255. After the fix: the arguments reach test.bat unchanged and it exits 0, for Copilot OTel, Copilot (1/2) and Codex (2/2).
  • --help prints Usage: test-integration.bat [options].
  • def 111 proof 492643, Windows x64: Run Agent Host E2E tests (Electron) succeeded. All 8 (1/2) and (2/2) processes plus the 2 single-process suites ran their tests, with 0 failing.

Authored with Copilot

Copilot AI balanced review requested due to automatic review settings November 3, 2026 23:42

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.

🟢 Approval recommended

No active review issues remain for the script-name handling fix, though the Windows CI proof run is still pending.

No open issues 🎉

What changed in this PR

Fixes Windows Agent Host E2E startup failures caused by argument parsing changing %0, allowing parentheses in the last argument to break the help block.

Changes:

  • Captures the script filename before shift processes arguments.
  • Uses the saved filename in help usage and examples, also correcting --help output.

No actionable findings remain. The Windows CI proof run is pending per the PR description.

File Description
scripts/​test-integration.bat Saves SCRIPT_NAME before argument parsing and uses it throughout the help block.

Review effort: Balanced

@amunger
Aaron Munger (amunger) marked this pull request as ready for review November 4, 2026 00:07
@amunger
Aaron Munger (amunger) enabled auto-merge (squash) November 4, 2026 00:08
shift also shifts %0, so after the argument loop %~nx0 is the last argument.
Since #345871 the Agent Host E2E runner passes --tfs values such as
"Integration Tests Copilot (1/2) full", which made %~nx0 "2) full". cmd
parses the whole help block even when it does not run it, so the ")" ended
the block and every two-process suite failed with "full was unexpected at
this time." on Windows. Save the script name before parsing instead.

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

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.

🟢 Approval recommended

No active review issues remain for the Windows integration-test launcher fix.

No open issues 🎉

Review effort: Balanced

@amunger
Aaron Munger (amunger) merged commit dc9775d into main Nov 4, 2026
60 checks passed
@amunger
Aaron Munger (amunger) deleted the copilot/vscode/test-integration-bat-script-name branch November 4, 2026 00:27
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 4, 2026
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.

3 participants