71 lines
1.3 KiB
Bash
71 lines
1.3 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
setup_file(){
|
|
load "$PWD/tests/integration/helpers/common"
|
|
_common_setup
|
|
_add_server
|
|
_new_app
|
|
}
|
|
|
|
teardown_file(){
|
|
_rm_app
|
|
_rm_server
|
|
}
|
|
|
|
setup(){
|
|
load "$PWD/tests/integration/helpers/common"
|
|
_common_setup
|
|
}
|
|
|
|
teardown(){
|
|
_undeploy_app
|
|
}
|
|
|
|
@test "validate app argument" {
|
|
run $ABRA app undeploy
|
|
assert_failure
|
|
assert_output --partial 'no app provided'
|
|
|
|
run $ABRA app undeploy DOESNTEXIST
|
|
assert_failure
|
|
assert_output --partial 'cannot find app'
|
|
}
|
|
|
|
@test "error if not deployed" {
|
|
run $ABRA app undeploy "$TEST_APP_DOMAIN"
|
|
assert_failure
|
|
assert_output --partial 'is not deployed'
|
|
}
|
|
|
|
# bats test_tags=slow
|
|
@test "undeploy app" {
|
|
run $ABRA app deploy "$TEST_APP_DOMAIN" --no-input
|
|
assert_success
|
|
|
|
run $ABRA app undeploy "$TEST_APP_DOMAIN" --no-input
|
|
assert_success
|
|
|
|
# NOTE(d1): ensure not chaos undeploy
|
|
assert_output --partial 'false'
|
|
}
|
|
|
|
# bats test_tags=slow
|
|
@test "undeploy and prune" {
|
|
_deploy_app
|
|
|
|
run $ABRA app undeploy "$TEST_APP_DOMAIN" --no-input --prune
|
|
assert_success
|
|
}
|
|
|
|
# bats test_tags=slow
|
|
@test "undeploy chaos deployment" {
|
|
run $ABRA app deploy "$TEST_APP_DOMAIN" \
|
|
--no-input --no-converge-checks --chaos
|
|
|
|
_undeploy_app
|
|
|
|
# NOTE(d1): ensure chaos undeploy
|
|
assert_output --partial ${_get_current_hash:0:8}
|
|
refute_output --partial 'false'
|
|
}
|