devcontainers / devcontainers/cli

Testing features not possible on Windows

未关闭
#757 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
TypeScript
星标
3k
派生
457
平均合并
13 小时 17 分钟
30 天内合并 PR
6

描述

I am trying to build a feature, and I failed. So I wrote a test to see what failed. However, when trying to execute my test, I get this error:

```
🚀 Launched container.
> containerId: 765681ff36037ff597185005ba19c57bd1db92eccda9bbd6127d536fd97c6c2e

🏃 Starting test(s)...

🧪 Starting 'oh-my-posh' tests...
Error: Exectuable 'chmod' not found on PATH 'C:\Program Files\PowerShell\7;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;...'.
at EF (C:\Users\SebastianGingter\AppData\Roaming\npm\node_modules\@devcontainers\cli\dist\spec-node\devContainersSpecCLI.js:150:4280)
at async Object.exec (C:\Users\SebastianGingter\AppData\Roaming\npm\node_modules\@devcontainers\cli\dist\spec-node\devContainersSpecCLI.js:150:1655)
at async W0 (C:\Users\SebastianGingter\AppData\Roaming\npm\node_modules\@devcontainers\cli\dist\spec-node\devContainersSpecCLI.js:591:83)
at async WtA (C:\Users\SebastianGingter\AppData\Roaming\npm\node_modules\@devcontainers\cli\dist\spec-node\devContainersSpecCLI.js:572:678)
at async jtA (C:\Users\SebastianGingter\AppData\Roaming\npm\node_modules\@devcontainers\cli\dist\spec-node\devContainersSpecCLI.js:572:197)
at async $H (C:\Users\SebastianGingter\AppData\Roaming\npm\node_modules\@devcontainers\cli\dist\spec-node\devContainersSpecCLI.js:567:190)
at async AiA (C:\Users\SebastianGingter\AppData\Roaming\npm\node_modules\@devcontainers\cli\dist\spec-node\devContainersSpecCLI.js:591:4218)
at async C:\Users\SebastianGingter\AppData\Roaming\npm\node_modules\@devcontainers\cli\dist\spec-node\devContainersSpecCLI.js:591:3506 {
code: 'ENOENT'
}
```

It seems, the `execTest` method in `testCommandImpl.ts` hardcodes a call to `chmod`, which is executed on the `cliHost`. In my case this is Windows, which does not have a `chmod`.

See https://github.com/devcontainers/cli/blob/2a6ab1ac82f4917654205e2a9b1ac928260d902e/src/spec-node/featuresCLI/testCommandImpl.ts#L596

There's another `cliHost.exec()` call to `chmod` in line 539:
https://github.com/devcontainers/cli/blob/2a6ab1ac82f4917654205e2a9b1ac928260d902e/src/spec-node/featuresCLI/testCommandImpl.ts#L539

Maybe the `chmod` should be done in the container, and not on the host?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。