forked from toolshed/abra
fix: app cmd parsing, usage & tests
Note: the integration tests don't work due to ValidateApp still attempting to validate the host key for the test app which doesn't exist. This will be fixed in a future commit.
This commit is contained in:
1
tests/integration/.gitignore
vendored
Normal file
1
tests/integration/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
logs
|
14
tests/integration/cmd.sh
Executable file
14
tests/integration/cmd.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
source ./testfunctions.sh
|
||||
source ./common.sh
|
||||
|
||||
create_server_app_recipe
|
||||
|
||||
run_test '$ABRA app cmd foo.com test --local'
|
||||
|
||||
run_test '$ABRA app cmd foo.com test --local -- foo'
|
||||
|
||||
run_test '$ABRA app cmd foo.com test --local -- foo bar baz'
|
||||
|
||||
clean_server_app_recipe
|
@ -2,6 +2,16 @@
|
||||
|
||||
set -e
|
||||
|
||||
create_server_app_recipe() {
|
||||
ln -srf ../resources/testapp ~/.abra/servers/foo.com
|
||||
ln -srf ../resources/testrecipe ~/.abra/recipes
|
||||
}
|
||||
|
||||
clean_server_app_recipe() {
|
||||
unlink ~/.abra/servers/foo.com
|
||||
unlink ~/.abra/recipes/testrecipe
|
||||
}
|
||||
|
||||
function init() {
|
||||
ABRA="$(pwd)/../../abra"
|
||||
INSTALLER_URL="https://git.coopcloud.tech/coop-cloud/abra/raw/branch/main/scripts/installer/installer"
|
||||
|
@ -16,7 +16,7 @@ run_test () {
|
||||
echo $logfile
|
||||
}
|
||||
|
||||
testScripts=("app.sh" "autocomplete.sh" "catalogue.sh" "install.sh" "recipe.sh" "records.sh" "server.sh")
|
||||
testScripts=("app.sh" "autocomplete.sh" "catalogue.sh" "install.sh" "recipe.sh" "records.sh" "server.sh", "cmd.sh")
|
||||
|
||||
for i in "${testScripts[@]}"; do
|
||||
cmd="./$i $res_dir${i/sh/log}"
|
||||
|
1
tests/resources/testapp/foo.com.env
Normal file
1
tests/resources/testapp/foo.com.env
Normal file
@ -0,0 +1 @@
|
||||
TYPE=test
|
1
tests/resources/testapp/testapp
Symbolic link
1
tests/resources/testapp/testapp
Symbolic link
@ -0,0 +1 @@
|
||||
.
|
5
tests/resources/testrecipe/abra.sh
Normal file
5
tests/resources/testrecipe/abra.sh
Normal file
@ -0,0 +1,5 @@
|
||||
test(){
|
||||
echo "1: $1"
|
||||
echo "2: $2"
|
||||
echo "all: $@"
|
||||
}
|
5
tests/resources/testrecipe/compose.yml
Normal file
5
tests/resources/testrecipe/compose.yml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
app: []
|
Reference in New Issue
Block a user