63 lines
1.2 KiB
Bash
63 lines
1.2 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
setup_file(){
|
|
load "$PWD/tests/integration/helpers/common"
|
|
_common_setup
|
|
_add_server
|
|
}
|
|
|
|
teardown_file(){
|
|
_rm_app
|
|
_rm_server
|
|
}
|
|
|
|
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 "create new app" {
|
|
run $ABRA app new "$TEST_RECIPE" \
|
|
--no-input \
|
|
--server "$TEST_SERVER" \
|
|
--domain "$TEST_APP_DOMAIN"
|
|
assert_success
|
|
assert_exists "$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
|
|
|
_rm_app
|
|
}
|
|
|
|
@test "does not overwrite existing env files" {
|
|
_new_app
|
|
|
|
run $ABRA app new "$TEST_RECIPE" \
|
|
--no-input \
|
|
--server "$TEST_SERVER" \
|
|
--domain "$TEST_APP_DOMAIN"
|
|
assert_failure
|
|
assert_output --partial 'already exists'
|
|
|
|
_rm_app
|
|
}
|
|
|
|
@test "generate secrets" {
|
|
run $ABRA app new "$TEST_RECIPE" \
|
|
--no-input \
|
|
--server "$TEST_SERVER" \
|
|
--domain "$TEST_APP_DOMAIN" \
|
|
--secrets
|
|
assert_success
|
|
assert_exists "$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
|
|
|
run $ABRA app secret ls "$TEST_APP_DOMAIN"
|
|
assert_success
|
|
assert_output --partial 'test_password'
|
|
}
|