Skip to content

Commit

Permalink
chore(tests): add
Browse files Browse the repository at this point in the history
  • Loading branch information
realSergiy committed Mar 19, 2024
1 parent a73ed4a commit 64111dd
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 166 deletions.
2 changes: 1 addition & 1 deletion src/git-subtree/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "git subtree (for Debian/Ubuntu)",
"documentationURL": "https://manpages.debian.org/testing/git-man/git-subtree.1.en.html",
"id": "git subtree",
"id": "git-subtree",
"version": "0.0.1",
"description": "Installs 'git subtree' on Ubuntu"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ set -e
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
git-subtree
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)'"
# 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
Expand Down
7 changes: 1 addition & 6 deletions test/_global/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
"color_and_hello": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"color": {
"favorite": "purple"
},
"hello": {
"greeting": "Greetings"
}
"git-subtree": {}
}
}
}
17 changes: 0 additions & 17 deletions test/color/green.sh

This file was deleted.

31 changes: 0 additions & 31 deletions test/color/my_favorite_color_is_green.sh

This file was deleted.

33 changes: 0 additions & 33 deletions test/color/scenarios.json

This file was deleted.

8 changes: 3 additions & 5 deletions test/hello/scenarios.json → test/git-subtree/scenarios.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"hello": {
"successfully-installed": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"hello": {
"greeting": "hello"
}
"git-subtree": {}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ source dev-container-features-test-lib

# Feature-specific tests
# The 'check' command comes from the dev-container-features-test-lib.
check "execute command" bash -c "color | grep 'my favorite color is gold'"
check "execute command" bash -c "git subtree add --help | grep 'usage: git subtree add'"

# Report result
# If any of the checks above exited with a non-zero exit code, the test will fail.
Expand Down
6 changes: 3 additions & 3 deletions test/color/test.sh → test/git-subtree/test.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/bin/bash

# This test file will be executed against an auto-generated devcontainer.json that
# includes the 'color' Feature with no options.
# includes the 'git-subtree' Feature with no options.
#
# For more information, see: https://github.com/devcontainers/cli/blob/main/docs/features/test.md
#
# Eg:
# {
# "image": "<..some-base-image...>",
# "features": {
# "color": {}
# "git-subtree": {}
# },
# "remoteUser": "root"
# }
Expand Down Expand Up @@ -40,7 +40,7 @@ source dev-container-features-test-lib
# Feature-specific tests
# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
# check <LABEL> <cmd> [args...]
check "validate favorite color" color | grep 'my favorite color is red'
check "validate installed" git subtree add --help | grep 'usage: git subtree add'

# Report result
# If any of the checks above exited with a non-zero exit code, the test will fail.
Expand Down
17 changes: 0 additions & 17 deletions test/hello/hello.sh

This file was deleted.

47 changes: 0 additions & 47 deletions test/hello/test.sh

This file was deleted.

0 comments on commit 64111dd

Please sign in to comment.