cli icon indicating copy to clipboard operation
cli copied to clipboard

Make dev-container-features-test-lib script POSIX compliant (fixes #438)

Open garymacindoe opened this issue 11 months ago • 4 comments

I've rewritten the dev-container-features-test-lib script included in the devcontainer CLI to be POSIX-compliant (using shellcheck).

This fixes tests against images where the default shell is not Bash (such as in #438).

garymacindoe avatar Feb 16 '25 10:02 garymacindoe

@microsoft-github-policy-service agree

garymacindoe avatar Feb 16 '25 11:02 garymacindoe

Thank you! Have you by chance run against a repo that has a lot of test scripts, like https://github.com/devcontainers/features?

joshspicer avatar Feb 18 '25 19:02 joshspicer

I have run tests against devcontainers/features using the version of the devcontainers CLI built from this PR. There are a few failures but they all seem to be because upstream repos have been removed or other failures unrelated to the changes in this PR.

https://github.com/garymacindoe/features/actions/runs/13408523890

garymacindoe avatar Feb 19 '25 13:02 garymacindoe

I have forked the devcontainers/features repository and fixed most of the tests as they fail on the default branch with the current version of the devcontainers-cli. The latest test run is https://github.com/garymacindoe/features/actions/runs/13595482653.

The main things that were failing were installing node LTS then checking that node 20 is installed when node 22 is the current LTS. As the LTS version of node is hardcoded in the test script it will start to fail again when a new version of node enters LTS.

There were a couple of missing dependencies to successfully build git from source.

The Python scenarios still fail for me in GitHub Actions because I don't have access to a big enough runner but pass for me locally.

The dotnet LTS install also fails because the install script correctly installs version 8 which is the current LTS but the test script queries https://builds.dotnet.microsoft.com/dotnet/Sdk/LTS/latest.version which currently returns 9.0.200. I haven't been able to fix that as I'm not sure of the correct API to use.

garymacindoe avatar Feb 28 '25 23:02 garymacindoe