diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7e562be..91aefc5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -35,6 +35,7 @@ jobs: features: - azure-cli-persistence - shell-history + - dev-tunnels steps: - uses: actions/checkout@v4 diff --git a/test-project/.devcontainer/devcontainer.json b/test-project/.devcontainer/devcontainer.json index 011a171..b94543e 100644 --- a/test-project/.devcontainer/devcontainer.json +++ b/test-project/.devcontainer/devcontainer.json @@ -18,6 +18,7 @@ "extensions": "containerapp,ssh" }, "./src/shell-history": {}, - "./src/azure-cli-persistence": {} + "./src/azure-cli-persistence": {}, + "./src/dev-tunnels" : {} } } diff --git a/test-project/DevTunnels/devtunnels.json b/test-project/DevTunnels/devtunnels.json new file mode 100644 index 0000000..1686d07 --- /dev/null +++ b/test-project/DevTunnels/devtunnels.json @@ -0,0 +1 @@ +{"Version":"1.0.1401\u002B3d725ee539"} \ No newline at end of file diff --git a/test/_global/color_and_hello.sh b/test/_global/color_and_hello.sh deleted file mode 100644 index 04c9822..0000000 --- a/test/_global/color_and_hello.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -# The 'test/_global' folder is a special test folder that is not tied to a single feature. -# -# This test file is executed against a running container constructed -# from the value of 'color_and_hello' in the tests/_global/scenarios.json file. -# -# The value of a scenarios element is any properties available in the 'devcontainer.json'. -# Scenarios are useful for testing specific options in a feature, or to test a combination of features. -# -# This test can be run with the following command (from the root of this repo) -# devcontainer features test --global-scenarios-only . - -set -e - -# Optional: Import test library bundled with the devcontainer CLI -source dev-container-features-test-lib - -echo -e "The result of the 'color' command will be:\n" -color -echo -e "The result of the 'hello' command will be:\n" -hello -echo -e "\n" - -# Feature-specific tests -# The 'check' command comes from the dev-container-features-test-lib. -check "check purple is my favorite color" color | grep 'my favorite color is purple' -check "check I am greeting with 'Greetings'" hello | grep 'Greetings, root' - - -# Report result -# If any of the checks above exited with a non-zero exit code, the test will fail. -reportResults diff --git a/test/_global/scenarios.json b/test/_global/scenarios.json deleted file mode 100644 index b046998..0000000 --- a/test/_global/scenarios.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "color_and_hello": { - "image": "mcr.microsoft.com/devcontainers/base:ubuntu", - "features": { - "color": { - "favorite": "purple" - }, - "hello": { - "greeting": "Greetings" - } - } - } -} \ No newline at end of file diff --git a/test/dev-tunnels/base.sh b/test/dev-tunnels/base.sh new file mode 100644 index 0000000..3139b9c --- /dev/null +++ b/test/dev-tunnels/base.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -e + +# Optional: Import test library bundled with the devcontainer CLI +# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib +# Provides the 'check' and 'reportResults' commands. +source dev-container-features-test-lib + +# Feature-specific tests +# The 'check' command comes from the dev-container-features-test-lib. Syntax is... +# check