abra/tests/integration/app_ps.bats
decentral1se addbda9145
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
test: fixups for the changepocalypse
2024-07-09 09:41:49 +02:00

66 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 ps
assert_failure
assert_output --partial 'no app provided'
run $ABRA app ps DOESNTEXIST
assert_failure
assert_output --partial 'cannot find app'
}
@test "error if not deployed" {
run $ABRA app ps "$TEST_APP_DOMAIN"
assert_failure
assert_output --partial 'is not deployed'
}
# bats test_tags=slow
@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 --chaos
assert_success
headHash=$(_get_head_hash)
run $ABRA app ps "$TEST_APP_DOMAIN"
assert_success
assert_output --partial "$latestRelease"
assert_output --partial "${headHash:0:8}" # is a chaos deploy
}