57 lines
1.0 KiB
Bash
57 lines
1.0 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
|
|
_reset_recipe
|
|
}
|
|
|
|
setup(){
|
|
load "$PWD/tests/integration/helpers/common"
|
|
_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 services
|
|
assert_failure
|
|
assert_output --partial 'no app provided'
|
|
|
|
run $ABRA app services DOESNTEXIST
|
|
assert_failure
|
|
assert_output --partial 'cannot find app'
|
|
}
|
|
|
|
@test "error if not deployed" {
|
|
run $ABRA app services "$TEST_APP_DOMAIN"
|
|
assert_failure
|
|
assert_output --partial 'is not deployed'
|
|
}
|
|
|
|
# bats test_tags=slow
|
|
@test "list services" {
|
|
_deploy_app
|
|
|
|
run $ABRA app services "$TEST_APP_DOMAIN"
|
|
assert_success
|
|
|
|
sanitisedDomainName="${TEST_APP_DOMAIN//./_}"
|
|
assert_output --partial "$sanitisedDomainName_app"
|
|
assert_output --partial "nginx"
|
|
|
|
_undeploy_app
|
|
}
|