Initial commit

This commit is contained in:
2023-09-15 20:25:04 +03:00
committed by GitHub
commit 07e55c1006
22 changed files with 770 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
#!/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" bash -c "color | grep 'my favorite color is purple'"
check "check I am greeting with 'Greetings'" bash -c "hello | grep 'Greetings, $(whoami)'"
# Report result
# If any of the checks above exited with a non-zero exit code, the test will fail.
reportResults

View File

@@ -0,0 +1,13 @@
{
"color_and_hello": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"color": {
"favorite": "purple"
},
"hello": {
"greeting": "Greetings"
}
}
}
}