Skip to content

Commit

Permalink
add test scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
irfan.putra committed Jan 7, 2025
1 parent 67919df commit b39d2df
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/lazydocker-binary-release/devcontainer-feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "lazydocker",
"id": "lazydocker-binary-release",
"version": "1.0.0",
"description": "A simple terminal UI for both docker and docker-compose installed with binary release",
"description": "A simple terminal UI for both docker and docker-compose. Installed by linux binary release",
"documentationURL": "https://github.com/irfansofyana/devcontainer-features/src/lazy-docker-binary-release",
"options": {
"version": {
Expand Down
22 changes: 22 additions & 0 deletions test/lazydocker-binary-release/latest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# This test file will be executed against an auto-generated devcontainer.json that
# includes the 'lazydocker-binary-release' Feature with no options.
#
# For more information, see: https://github.com/devcontainers/cli/blob/main/docs/features/test.md
#
# Thus, the value of all options will fall back to the default value in the
# Feature's 'devcontainer-feature.json'.
# For the 'kcat-apt' feature, that means the default version is 'latest'.

set -e

# Optional: Import test library bundled with the devcontainer CLI
source dev-container-features-test-lib

# Feature-specific tests
# The 'check' command comes from the dev-container-features-test-lib.
check "lazydocker" lazydocker --version

# Report result
reportResults
16 changes: 16 additions & 0 deletions test/lazydocker-binary-release/scenarios.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"latest": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"lazydocker-binary-release": {}
}
},
"specific_version": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"kcat-apt": {
"version": "0.23.0"
}
}
}
}
13 changes: 13 additions & 0 deletions test/lazydocker-binary-release/specific-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -e

# Import test library
source dev-container-features-test-lib

# Feature-specific tests
check "validate lazydocker installation" which lazydocker
check "validate lazydocker version" lazydocker --version | grep "0.23.0"

# Report result
reportResults
8 changes: 0 additions & 8 deletions test/lazydocker-binary-release/test.sh

This file was deleted.

0 comments on commit b39d2df

Please sign in to comment.