abra/tests/integration/app_restart.bats
decentral1se 008582c3d9
All checks were successful
continuous-integration/drone/push Build is passing
test: fixes for test suite post-cobra migrate
See toolshed/organising#650
2024-12-27 20:44:07 +01:00

67 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 restart
assert_failure
run $ABRA app restart DOESNTEXIST
assert_failure
}
@test "error if service missing" {
run $ABRA app restart "$TEST_APP_DOMAIN"
assert_failure
}
@test "error if not deployed" {
run $ABRA app restart "$TEST_APP_DOMAIN" app
assert_failure
assert_output --partial 'is not deployed'
}
# bats test_tags=slow
@test "app is restarted" {
_deploy_app
run $ABRA app restart "$TEST_APP_DOMAIN" app --debug
assert_success
assert_output --regexp 'attempting to scale .* to 0'
assert_output --regexp 'attempting to scale .* to 1'
assert_output --partial 'service successfully restarted'
}
@test "cannot use <service> and --all-services together" {
run $ABRA app restart "$TEST_APP_DOMAIN" app --all-services
assert_failure
assert_output --regexp "cannot use .* together"
}
# bats test_tags=slow
@test "all services are restarted" {
_deploy_app
run $ABRA app restart "$TEST_APP_DOMAIN" --all-services --debug
assert_success
}