fix(cli-test): remove cmd.exe wrapping on Windows#2582
Conversation
…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>
|
Codecov Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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>
|
🔮 🚀 Will make an RC from this branch for testing purposes! |
Summary
/s /cwrapping on Windows ingetSpawnArguments— spawns CLI binary directly withshell: falseescapeJSONin datastore commands to return plainJSON.stringify(outer quotes were only needed for cmd.exe to consume)Context
In Windows Server ltsc2022 Docker containers, processes hang when they inherit Docker's entrypoint pipe handles. Node.js
child_process.spawnwithshell: trueuses cmd.exe, which also hangs. The previous approach wrapped CLI calls throughcmd /s /con Windows specifically to handle argument quoting — but this is incompatible with containerized CI environments.Test plan
cli-testunit tests pass (28/28)platform-devxp-testpass with this version🤖 Generated with Claude Code