From b2687886e59b2c111bdd655ba9724fbabc4052aa Mon Sep 17 00:00:00 2001 From: Chris Stefano Date: Wed, 14 Sep 2022 19:23:00 +0100 Subject: [PATCH 1/8] update test for soft dependency --- test/_global/scenario-without-python.sh | 5 ----- test/_global/scenarios.json | 15 --------------- .../default.sh} | 0 test/pip-test/scenarios.json | 9 +++++++++ test/pip-test/test.sh | 5 ----- 5 files changed, 9 insertions(+), 25 deletions(-) delete mode 100644 test/_global/scenario-without-python.sh delete mode 100644 test/_global/scenarios.json rename test/{_global/scenario-with-python.sh => pip-test/default.sh} (100%) create mode 100644 test/pip-test/scenarios.json delete mode 100644 test/pip-test/test.sh diff --git a/test/_global/scenario-without-python.sh b/test/_global/scenario-without-python.sh deleted file mode 100644 index a86e00a..0000000 --- a/test/_global/scenario-without-python.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -set -e -source dev-container-features-test-lib -check "version" pip --version -reportResults diff --git a/test/_global/scenarios.json b/test/_global/scenarios.json deleted file mode 100644 index e71581d..0000000 --- a/test/_global/scenarios.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "scenario-without-python": { - "image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04", - "features": { - "pip-test": {} - } - }, - "scenario-with-python": { - "image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04", - "features": { - "ghcr.io/devcontainers/features/python": {}, - "pip-test": {} - } - } -} diff --git a/test/_global/scenario-with-python.sh b/test/pip-test/default.sh similarity index 100% rename from test/_global/scenario-with-python.sh rename to test/pip-test/default.sh diff --git a/test/pip-test/scenarios.json b/test/pip-test/scenarios.json new file mode 100644 index 0000000..e405a83 --- /dev/null +++ b/test/pip-test/scenarios.json @@ -0,0 +1,9 @@ +{ + "default": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04", + "features": { + "python": {}, + "pip-test": {} + } + } +} diff --git a/test/pip-test/test.sh b/test/pip-test/test.sh deleted file mode 100644 index a86e00a..0000000 --- a/test/pip-test/test.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -set -e -source dev-container-features-test-lib -check "version" pip --version -reportResults From a5d7dce9db9a4922384c77811891227881b0bdc3 Mon Sep 17 00:00:00 2001 From: Chris Stefano Date: Wed, 14 Sep 2022 19:25:00 +0100 Subject: [PATCH 2/8] run tests on pull_request --- .github/workflows/test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index eeaa18d..907e261 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,6 +3,7 @@ on: push: branches: - main + pull_request: workflow_dispatch: jobs: From 91abe667bf0a43a1fb67580740aadae695d13cbb Mon Sep 17 00:00:00 2001 From: Chris Stefano Date: Wed, 14 Sep 2022 19:26:37 +0100 Subject: [PATCH 3/8] use latest CLI for tests --- .github/workflows/test.yaml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 907e261..28622f7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -22,8 +22,16 @@ jobs: steps: - uses: actions/checkout@v2 + # - name: "Install latest devcontainer CLI" + # run: npm install -g @devcontainers/cli + - name: "Install latest devcontainer CLI" - run: npm install -g @devcontainers/cli + run: | + git clone --depth 1 --branch main https://github.com/devcontainers/cli.git && + cd cli && + yarn && + yarn compile && + npm link - name: "Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'" run: devcontainer features test -f ${{ matrix.features }} -i ${{ matrix.baseImage }} . @@ -34,8 +42,16 @@ jobs: steps: - uses: actions/checkout@v2 + # - name: "Install latest devcontainer CLI" + # run: npm install -g @devcontainers/cli + - name: "Install latest devcontainer CLI" - run: npm install -g @devcontainers/cli + run: | + git clone --depth 1 --branch main https://github.com/devcontainers/cli.git && + cd cli && + yarn && + yarn compile && + npm link - name: "Testing global scenarios" run: devcontainer features test --global-scenarios-only . From b5d9bb2d5ea1325445ce1e98f55a72c3c5c65071 Mon Sep 17 00:00:00 2001 From: Chris Stefano Date: Wed, 12 Oct 2022 09:16:08 +0100 Subject: [PATCH 4/8] use fully qualified reference to python feature for installsAfter --- src/pip-test/devcontainer-feature.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pip-test/devcontainer-feature.json b/src/pip-test/devcontainer-feature.json index 97c0402..ee6c8bb 100644 --- a/src/pip-test/devcontainer-feature.json +++ b/src/pip-test/devcontainer-feature.json @@ -4,6 +4,6 @@ "version": "1.0.0", "description": "Testing installsAfter", "installsAfter": [ - "python" + "ghcr.io/devcontainers/features/python" ] } From 3bb47a367bad545a2da52819d8f733fba1d97153 Mon Sep 17 00:00:00 2001 From: Chris Stefano Date: Wed, 12 Oct 2022 09:38:37 +0100 Subject: [PATCH 5/8] use long-form command line switches for readability --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 28622f7..46b7b62 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -34,7 +34,7 @@ jobs: npm link - name: "Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'" - run: devcontainer features test -f ${{ matrix.features }} -i ${{ matrix.baseImage }} . + run: devcontainer features test --features ${{ matrix.features }} --base-image ${{ matrix.baseImage }} . test-global: runs-on: ubuntu-latest From 5d8b80d1669e458cd7a1d40776548781e945a0c0 Mon Sep 17 00:00:00 2001 From: Chris Stefano Date: Wed, 12 Oct 2022 09:39:40 +0100 Subject: [PATCH 6/8] use global test instead --- test/_global/pip-test.sh | 5 +++++ test/_global/scenarios.json | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 test/_global/pip-test.sh create mode 100644 test/_global/scenarios.json diff --git a/test/_global/pip-test.sh b/test/_global/pip-test.sh new file mode 100644 index 0000000..a86e00a --- /dev/null +++ b/test/_global/pip-test.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -e +source dev-container-features-test-lib +check "version" pip --version +reportResults diff --git a/test/_global/scenarios.json b/test/_global/scenarios.json new file mode 100644 index 0000000..102ca09 --- /dev/null +++ b/test/_global/scenarios.json @@ -0,0 +1,9 @@ +{ + "pip-test": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04", + "features": { + "ghcr.io/devcontainers/features/python": {}, + "pip-test": {} + } + } +} From d89d10c0eaf2f54ff21b4f6d4ecaec9a4337cffe Mon Sep 17 00:00:00 2001 From: Chris Stefano Date: Wed, 12 Oct 2022 09:40:34 +0100 Subject: [PATCH 7/8] refactor feature test ~ fails test --- test/pip-test/default.sh | 5 ----- test/pip-test/scenarios.json | 9 --------- test/pip-test/test.sh | 3 +++ 3 files changed, 3 insertions(+), 14 deletions(-) delete mode 100644 test/pip-test/default.sh delete mode 100644 test/pip-test/scenarios.json create mode 100644 test/pip-test/test.sh diff --git a/test/pip-test/default.sh b/test/pip-test/default.sh deleted file mode 100644 index a86e00a..0000000 --- a/test/pip-test/default.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -set -e -source dev-container-features-test-lib -check "version" pip --version -reportResults diff --git a/test/pip-test/scenarios.json b/test/pip-test/scenarios.json deleted file mode 100644 index e405a83..0000000 --- a/test/pip-test/scenarios.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "default": { - "image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04", - "features": { - "python": {}, - "pip-test": {} - } - } -} diff --git a/test/pip-test/test.sh b/test/pip-test/test.sh new file mode 100644 index 0000000..956049c --- /dev/null +++ b/test/pip-test/test.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +echo "Nothing doing... never gets here" From 1719c646dc94b45f82ebdd6552cc563333917ed1 Mon Sep 17 00:00:00 2001 From: Chris Stefano Date: Wed, 12 Oct 2022 09:53:21 +0100 Subject: [PATCH 8/8] only test with "global" scenario --- .github/workflows/test.yaml | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 46b7b62..e0792fa 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -7,35 +7,6 @@ on: workflow_dispatch: jobs: - test: - runs-on: ubuntu-latest - continue-on-error: true - strategy: - matrix: - features: [ - "pip-test" - ] - baseImage: - [ - "mcr.microsoft.com/devcontainers/base:ubuntu-22.04" - ] - steps: - - uses: actions/checkout@v2 - - # - name: "Install latest devcontainer CLI" - # run: npm install -g @devcontainers/cli - - - name: "Install latest devcontainer CLI" - run: | - git clone --depth 1 --branch main https://github.com/devcontainers/cli.git && - cd cli && - yarn && - yarn compile && - npm link - - - name: "Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'" - run: devcontainer features test --features ${{ matrix.features }} --base-image ${{ matrix.baseImage }} . - test-global: runs-on: ubuntu-latest continue-on-error: true