forked from toolshed/abra
refactor!: drop version, show versions in ps
See coop-cloud/organising#526 See coop-cloud/organising#502
This commit is contained in:
@ -41,8 +41,22 @@ teardown(){
|
||||
@test "show ps report" {
|
||||
_deploy_app
|
||||
|
||||
latestRelease=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" tag -l | tail -n 1)
|
||||
|
||||
run $ABRA app ps "$TEST_APP_DOMAIN"
|
||||
assert_success
|
||||
assert_output --partial 'app'
|
||||
assert_output --partial 'healthy'
|
||||
assert_output --partial "$latestRelease"
|
||||
assert_output --partial 'false' # not a chaos deploy
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "show ps report with chaos deploy" {
|
||||
run $ABRA app deploy "$TEST_APP_DOMAIN" \
|
||||
--no-input --no-converge-checks --chaos
|
||||
assert_success
|
||||
|
||||
assert_output --partial "$latestRelease"
|
||||
assert_output --partial 'true' # is a chaos deploy
|
||||
}
|
||||
|
@ -1,93 +0,0 @@
|
||||
#!/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
|
||||
_reset_recipe
|
||||
}
|
||||
|
||||
@test "validate app argument" {
|
||||
run $ABRA app version
|
||||
assert_failure
|
||||
assert_output --partial 'no app provided'
|
||||
|
||||
run $ABRA app version DOESNTEXIST
|
||||
assert_failure
|
||||
assert_output --partial 'cannot find app'
|
||||
}
|
||||
|
||||
@test "error if not deployed" {
|
||||
run $ABRA app version "$TEST_APP_DOMAIN"
|
||||
assert_failure
|
||||
assert_output --partial 'is not deployed'
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "error if version unknown" {
|
||||
run sed -i '/coop-cloud.${STACK_NAME}.version=.*/d' "$ABRA_DIR/recipes/$TEST_RECIPE/compose.yml"
|
||||
assert_success
|
||||
|
||||
run $ABRA app deploy "$TEST_APP_DOMAIN" \
|
||||
--no-input --no-converge-checks --chaos
|
||||
assert_success
|
||||
|
||||
run $ABRA app version "$TEST_APP_DOMAIN"
|
||||
assert_failure
|
||||
assert_output --partial 'failed to determine'
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "error if not in catalogue" {
|
||||
_deploy_app
|
||||
|
||||
run $ABRA app version "$TEST_APP_DOMAIN"
|
||||
assert_failure
|
||||
assert_output --partial 'does not exist'
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "list version" {
|
||||
appDomain="custom-html.$TEST_SERVER"
|
||||
|
||||
run $ABRA app new custom-html \
|
||||
--no-input \
|
||||
--server "$TEST_SERVER" \
|
||||
--domain "$appDomain"
|
||||
|
||||
latestVersion=$(git -C "$ABRA_DIR/recipes/custom-html" tag | tail -n 1)
|
||||
refute [ -z "$latestVersion" ];
|
||||
|
||||
run $ABRA app deploy "$appDomain" --no-input --no-converge-checks
|
||||
assert_success
|
||||
assert_output --partial "$latestVersion"
|
||||
|
||||
run $ABRA app version "$appDomain"
|
||||
assert_success
|
||||
assert_output --partial "$latestVersion"
|
||||
|
||||
run $ABRA app undeploy "$appDomain" --no-input
|
||||
assert_success
|
||||
|
||||
run $ABRA app volume remove "$appDomain" --no-input
|
||||
assert_success
|
||||
|
||||
run $ABRA app remove "$appDomain" --no-input
|
||||
assert_success
|
||||
assert_not_exists "$ABRA_DIR/servers/$TEST_SERVER/$appDomain.env"
|
||||
}
|
Reference in New Issue
Block a user