File tree Expand file tree Collapse file tree 6 files changed +98
-2
lines changed
Expand file tree Collapse file tree 6 files changed +98
-2
lines changed Original file line number Diff line number Diff line change 77 workflow_dispatch :
88
99jobs :
10- test :
10+ test-autogenerated :
1111 runs-on : ubuntu-latest
1212 continue-on-error : true
1313 strategy :
2626 run : npm install -g @devcontainers/cli
2727
2828 - name : " Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'"
29- run : devcontainer features test -f ${{ matrix.features }} -i ${{ matrix.baseImage }} .
29+ run : devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} .
30+
31+ test-scenarios :
32+ runs-on : ubuntu-latest
33+ continue-on-error : true
34+ strategy :
35+ matrix :
36+ features :
37+ - color
38+ - hello
39+ steps :
40+ - uses : actions/checkout@v3
41+
42+ - name : " Install latest devcontainer CLI"
43+ run : npm install -g @devcontainers/cli
44+
45+ - name : " Generating tests for '${{ matrix.features }}' scenarios"
46+ run : devcontainer features test -f ${{ matrix.features }} --skip-autogenerated .
3047
3148 test-global :
3249 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # This test file will be executed against one of the scenarios devcontainer.json test that
4+ # includes the 'color' feature with "favorite": "gold" option.
5+
6+ set -e
7+
8+ # Optional: Import test library bundled with the devcontainer CLI
9+ source dev-container-features-test-lib
10+
11+ # Feature-specific tests
12+ # The 'check' command comes from the dev-container-features-test-lib.
13+ check " version" bash -c " color | grep 'my favorite color is gold'"
14+
15+ # Report result
16+ # If any of the checks above exited with a non-zero exit code, the test will fail.
17+ reportResults
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # This test file will be executed against one of the scenarios devcontainer.json test that
4+ # includes the 'color' feature with "favorite": "green" option.
5+
6+ set -e
7+
8+ # Optional: Import test library bundled with the devcontainer CLI
9+ source dev-container-features-test-lib
10+
11+ # Feature-specific tests
12+ # The 'check' command comes from the dev-container-features-test-lib.
13+ check " version" bash -c " color | grep 'my favorite color is green'"
14+
15+ # Report result
16+ # If any of the checks above exited with a non-zero exit code, the test will fail.
17+ reportResults
Original file line number Diff line number Diff line change 1+ {
2+ "gold" : {
3+ "image" : " mcr.microsoft.com/devcontainers/base:ubuntu" ,
4+ "features" : {
5+ "color" : {
6+ "favorite" : " gold"
7+ }
8+ }
9+ },
10+ "green" : {
11+ "image" : " mcr.microsoft.com/devcontainers/base:ubuntu" ,
12+ "features" : {
13+ "color" : {
14+ "favorite" : " green"
15+ }
16+ }
17+ }
18+ }
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # This test file will be executed against one of the scenarios devcontainer.json test that
4+ # includes the 'color' feature with "greeting": "hello" option.
5+
6+ set -e
7+
8+ # Optional: Import test library bundled with the devcontainer CLI
9+ source dev-container-features-test-lib
10+
11+ # Feature-specific tests
12+ # The 'check' command comes from the dev-container-features-test-lib.
13+ check " version" bash -c " hello | grep 'hello, $( whoami) !'"
14+
15+ # Report results
16+ # If any of the checks above exited with a non-zero exit code, the test will fail.
17+ reportResults
Original file line number Diff line number Diff line change 1+ {
2+ "hello" : {
3+ "image" : " mcr.microsoft.com/devcontainers/base:ubuntu" ,
4+ "features" : {
5+ "hello" : {
6+ "greeting" : " hello"
7+ }
8+ }
9+ }
10+ }
You can’t perform that action at this time.
0 commit comments