Skip to content

Commit 48df1b1

Browse files
committed
Corrections in test scripts as per review comment.
1 parent 870e4c1 commit 48df1b1

6 files changed

Lines changed: 42 additions & 0 deletions

File tree

test/docker-in-docker/docker_build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ check "docker-compose" bash -c "docker-compose --version | grep -E '2.[0-9]+.[0-
1515
check "docker-buildx" bash -c "docker buildx version"
1616
check "docker-buildx-path" bash -c "ls -la /usr/libexec/docker/cli-plugins/docker-buildx"
1717

18+
check "Not installing compose-switch by default" bash -c "[[ ! -f /usr/local/bin/compose-switch ]]"
19+
1820
# Report result
1921
reportResults
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Optional: Import test library
6+
source dev-container-features-test-lib
7+
8+
# Definition specific tests
9+
check "docker-buildx" docker buildx version
10+
check "docker-build" docker build ./
11+
12+
check "docker compose" bash -c "docker compose version | grep -E '2.[0-9]+.[0-9]+'"
13+
check "docker-compose" bash -c "docker-compose --version | grep -E '2.[0-9]+.[0-9]+'"
14+
15+
check "docker-buildx" bash -c "docker buildx version"
16+
check "docker-buildx-path" bash -c "ls -la /usr/libexec/docker/cli-plugins/docker-buildx"
17+
18+
check "installs compose-switch as the flag is on" bash -c "[[ -f /usr/local/bin/compose-switch ]]"
19+
20+
# Report result
21+
reportResults
22+

test/docker-in-docker/docker_buildx.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ check "docker-build" docker build ./
1414

1515
check "installs docker-compose v1 install" bash -c "type docker-compose"
1616

17+
check "Not installing compose-switch by default" bash -c "[[ ! -f /usr/local/bin/compose-switch ]]"
18+
1719
# Report result
1820
reportResults

test/docker-in-docker/docker_compose_v2.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ check "docker compose" bash -c "docker compose version | grep -E '2.[0-9]+.[0-9]
1111
check "docker-compose" bash -c "docker-compose --version | grep -E '2.[0-9]+.[0-9]+'"
1212
check "installs compose-switch as docker-compose" bash -c "[[ -f /usr/local/bin/docker-compose ]]"
1313

14+
check "Not installing compose-switch by default" bash -c "[[ ! -f /usr/local/bin/compose-switch ]]"
15+
1416
# Report result
1517
reportResults

test/docker-in-docker/docker_specific_moby_buildx.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ check "docker-build" docker build ./
1515

1616
check "installs docker-compose v1 install" bash -c "type docker-compose"
1717

18+
check "Not installing compose-switch by default" bash -c "[[ ! -f /usr/local/bin/compose-switch ]]"
19+
1820
# Report result
1921
reportResults

test/docker-in-docker/scenarios.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@
5555
},
5656
"remoteUser": "node"
5757
},
58+
"docker_build_with_compose_switch": {
59+
"image": "mcr.microsoft.com/devcontainers/javascript-node:0-18",
60+
"features": {
61+
"docker-in-docker": {
62+
"version": "latest",
63+
"moby": "false",
64+
"dockerDashComposeVersion": "v2",
65+
"installDockerComposeSwitch": true
66+
}
67+
},
68+
"remoteUser": "node"
69+
},
5870
"docker_build_2": {
5971
"image": "ubuntu:noble",
6072
"features": {

0 commit comments

Comments
 (0)