Skip to content

Commit 5534534

Browse files
Add more shellcheck tests
1 parent 121c535 commit 5534534

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

test/shellcheck/scenarios.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"shellcheck-version": {
3+
"image": "debian:latest",
4+
"features": {
5+
"shellcheck": {
6+
"version": "0.5.0"
7+
}
8+
}
9+
},
10+
11+
"shellcheck-install-path": {
12+
"image": "debian:latest",
13+
"features": {
14+
"shellcheck": {
15+
"installPath": "/usr/bin"
16+
}
17+
}
18+
}
19+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
# Optional: Import test library bundled with the devcontainer CLI
6+
# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib
7+
# Provides the 'check' and 'reportResults' commands.
8+
# shellcheck source=/dev/null
9+
source dev-container-features-test-lib
10+
11+
# Feature-specific tests
12+
# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
13+
# check <LABEL> <cmd> [args...]
14+
check "which shellcheck" bash -c "which shellcheck | grep /usr/bin/shellcheck"
15+
16+
# Report result
17+
# If any of the checks above exited with a non-zero exit code, the test will fail.
18+
reportResults
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
# Optional: Import test library bundled with the devcontainer CLI
6+
# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib
7+
# Provides the 'check' and 'reportResults' commands.
8+
# shellcheck source=/dev/null
9+
source dev-container-features-test-lib
10+
11+
# Feature-specific tests
12+
# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
13+
# check <LABEL> <cmd> [args...]
14+
check "version" bash -c "shellcheck --version | grep 0.5.0"
15+
16+
# Report result
17+
# If any of the checks above exited with a non-zero exit code, the test will fail.
18+
reportResults

0 commit comments

Comments
 (0)