|
1 | 1 | #!/bin/bash |
2 | 2 |
|
3 | 3 | # This test file will be executed against an auto-generated devcontainer.json that |
4 | | -# includes the 'color' feature with no options. |
| 4 | +# includes the 'color' Feature with no options. |
| 5 | +# |
| 6 | +# For more information, see: https://github.com/devcontainers/cli/blob/main/docs/features/test.md |
5 | 7 | # |
6 | 8 | # Eg: |
7 | 9 | # { |
8 | 10 | # "image": "<..some-base-image...>", |
9 | 11 | # "features": { |
10 | 12 | # "color": {} |
11 | | -# } |
| 13 | +# }, |
| 14 | +# "remoteUser": "root" |
12 | 15 | # } |
13 | 16 | # |
14 | | -# Thus, the value of all options, |
15 | | -# will fall back to the default value in the feature's 'devcontainer-feature.json' |
| 17 | +# Thus, the value of all options will fall back to the default value in the |
| 18 | +# Feature's 'devcontainer-feature.json'. |
16 | 19 | # For the 'color' feature, that means the default favorite color is 'red'. |
| 20 | +# |
| 21 | +# These scripts are run as 'root' by default. Although that can be changed |
| 22 | +# with the '--remote-user' flag. |
17 | 23 | # |
18 | | -# This test can be run with the following command (from the root of this repo) |
19 | | -# devcontainer features test \ |
20 | | -# --features color \ |
21 | | -# --base-image mcr.microsoft.com/devcontainers/base:ubuntu . |
| 24 | +# This test can be run with the following command: |
| 25 | +# |
| 26 | +# devcontainer features test \ |
| 27 | +# --features color \ |
| 28 | +# --remote-user root \ |
| 29 | +# --skip-scenarios \ |
| 30 | +# --base-image mcr.microsoft.com/devcontainers/base:ubuntu \ |
| 31 | +# /path/to/this/repo |
22 | 32 |
|
23 | 33 | set -e |
24 | 34 |
|
25 | 35 | # Optional: Import test library bundled with the devcontainer CLI |
| 36 | +# Provides the 'check' and 'reportResults' commands. |
26 | 37 | source dev-container-features-test-lib |
27 | 38 |
|
28 | 39 | # Feature-specific tests |
29 | 40 | # The 'check' command comes from the dev-container-features-test-lib. |
30 | | -check "version" bash -c "color | grep 'my favorite color is red'" |
| 41 | + |
| 42 | +check "validate favorite color" color | grep 'my favorite color is red' |
31 | 43 |
|
32 | 44 | # Report result |
33 | 45 | # If any of the checks above exited with a non-zero exit code, the test will fail. |
|
0 commit comments