devcontainers / devcontainers/cli

Testing features not possible on Windows

Abierto
#757 3 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
TypeScript
Estrellas
3k
Forks
457
Merge medio
13 h 17 min
PR fusionados (30 d)
6

Descripción

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?

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.