forked from toolshed/abra
test: test arguments, notes, local tag lookup
This commit is contained in:
@ -17,6 +17,13 @@ setup(){
|
||||
_common_setup
|
||||
}
|
||||
|
||||
teardown(){
|
||||
# https://github.com/bats-core/bats-core/issues/383#issuecomment-738628888
|
||||
if [[ -z "${BATS_TEST_COMPLETED}" ]]; then
|
||||
_undeploy_app
|
||||
fi
|
||||
}
|
||||
|
||||
@test "validate app argument" {
|
||||
run $ABRA app version
|
||||
assert_failure
|
||||
@ -61,38 +68,16 @@ setup(){
|
||||
_undeploy_app
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "list version" {
|
||||
latestVersion=$(jq -r '.gitea.versions[-1] | keys[0]' < "$ABRA_DIR/catalogue/recipes.json")
|
||||
_deploy_app
|
||||
|
||||
latestVersion=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" git tag | tail -n 1)
|
||||
refute [ -z "$latestVersion" ];
|
||||
|
||||
run $ABRA app new gitea \
|
||||
--no-input \
|
||||
--server "$TEST_SERVER" \
|
||||
--domain "gitea.$TEST_SERVER" \
|
||||
--secrets
|
||||
assert_success
|
||||
|
||||
run $ABRA app deploy "gitea.$TEST_SERVER" \
|
||||
--no-input --no-converge-checks
|
||||
assert_success
|
||||
|
||||
run $ABRA app version "gitea.$TEST_SERVER"
|
||||
run $ABRA app version "$TEST_APP_DOMAIN"
|
||||
assert_success
|
||||
assert_output --partial "$latestVersion"
|
||||
|
||||
run $ABRA app undeploy "gitea.$TEST_SERVER" --no-input
|
||||
assert_success
|
||||
|
||||
run $ABRA app secret remove "gitea.$TEST_SERVER" --all --no-input
|
||||
assert_success
|
||||
|
||||
# NOTE(d1): to let the stack come down before nuking volumes
|
||||
sleep 5
|
||||
|
||||
run $ABRA app volume remove "gitea.$TEST_SERVER" --no-input
|
||||
assert_success
|
||||
|
||||
run $ABRA app remove "gitea.$TEST_SERVER" --no-input
|
||||
assert_success
|
||||
assert_not_exists "$ABRA_DIR/servers/$TEST_SERVER/gitea.$TEST_SERVER.env"
|
||||
_undeploy_app
|
||||
}
|
||||
|
Reference in New Issue
Block a user