Skip to content

fix(cli-test): remove cmd.exe wrapping on Windows#2582

Draft
zimeg wants to merge 5 commits intomainfrom
zimeg-cli-test-fix-windows
Draft

fix(cli-test): remove cmd.exe wrapping on Windows#2582
zimeg wants to merge 5 commits intomainfrom
zimeg-cli-test-fix-windows

Conversation

@zimeg
Copy link
Copy Markdown
Member

@zimeg zimeg commented May 6, 2026

Summary

  • Removes cmd.exe /s /c wrapping on Windows in getSpawnArguments — spawns CLI binary directly with shell: false
  • Fixes escapeJSON in datastore commands to return plain JSON.stringify (outer quotes were only needed for cmd.exe to consume)
  • Prevents process hangs in Windows Server Docker containers caused by pipe handle inheritance from Docker's entrypoint

Context

In Windows Server ltsc2022 Docker containers, processes hang when they inherit Docker's entrypoint pipe handles. Node.js child_process.spawn with shell: true uses cmd.exe, which also hangs. The previous approach wrapped CLI calls through cmd /s /c on Windows specifically to handle argument quoting — but this is incompatible with containerized CI environments.

Test plan

  • All existing cli-test unit tests pass (28/28)
  • Windows E2E tests in platform-devxp-test pass with this version

🤖 Generated with Claude Code

…iner hangs

In Windows Server Docker containers, processes hang when they inherit
Docker's entrypoint pipe handles. Using cmd.exe (via shell:true or the
explicit /s /c wrapper) triggers this issue. This change spawns the CLI
binary directly on Windows with shell:false.

Also simplifies escapeJSON in datastore commands since outer quote
wrapping is no longer needed without cmd.exe consuming them.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 6, 2026

⚠️ No Changeset found

Latest commit: a77f94d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.52%. Comparing base (5bc7685) to head (a77f94d).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2582      +/-   ##
==========================================
+ Coverage   87.50%   87.52%   +0.02%     
==========================================
  Files          62       62              
  Lines       10256    10228      -28     
  Branches      418      418              
==========================================
- Hits         8974     8952      -22     
+ Misses       1260     1254       -6     
  Partials       22       22              
Flag Coverage Δ
cli-hooks 87.52% <66.66%> (+0.02%) ⬆️
cli-test 87.52% <66.66%> (+0.02%) ⬆️
logger 87.52% <66.66%> (+0.02%) ⬆️
oauth 87.52% <66.66%> (+0.02%) ⬆️
socket-mode 87.52% <66.66%> (+0.02%) ⬆️
web-api 87.52% <66.66%> (+0.02%) ⬆️
webhook 87.52% <66.66%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

zimeg and others added 3 commits May 6, 2026 09:55
The generic env parameter tests hardcoded shell:true but on Windows
it's now shell:false. Use process.platform to set the expected value.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Using shell:true causes issues with special characters like # being
interpreted as comments. Spawning the CLI binary directly with
shell:false avoids both the Windows Docker hang and the need for
outer-quote hacks to protect shell metacharacters.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
- Remove redundant platform if-branch in getSpawnArguments (both paths
  were identical after shell:false change)
- Inline escapeJSON as JSON.stringify at call sites
- Inline expectedShell constant directly in test assertions

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg
Copy link
Copy Markdown
Member Author

zimeg commented May 6, 2026

🔮 🚀 Will make an RC from this branch for testing purposes!

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.

1 participant