76 lines
1.8 KiB
Bash
76 lines
1.8 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
|
|
_reset_recipe
|
|
}
|
|
|
|
@test "deploy then upgrade" {
|
|
run $ABRA app deploy "$TEST_APP_DOMAIN" "0.1.0+1.20.0" \
|
|
--no-input --no-converge-checks
|
|
assert_success
|
|
|
|
run $ABRA app upgrade "$TEST_APP_DOMAIN" "0.2.0+1.21.0" \
|
|
--no-input --no-converge-checks
|
|
assert_success
|
|
|
|
# current deployment
|
|
assert_output --regexp 'VERSION.*' + "0.1.0+1.20.0"
|
|
assert_output --regexp 'CHAOS.*false'
|
|
|
|
# new deployment
|
|
assert_output --regexp 'VERSION.*' + "0.2.0+1.21.0"
|
|
assert_output --regexp 'CHAOS.*false'
|
|
|
|
# env version
|
|
assert_output --regexp 'CURRENT VERSION.*' + "0.1.0+1.20.0"
|
|
assert_output --regexp 'NEW VERSION.*' + "0.2.0+1.21.0"
|
|
|
|
run grep -q "TYPE=$TEST_RECIPE:0.2.0+1.21.0" \
|
|
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
|
assert_success
|
|
}
|
|
|
|
@test "force upgrade" {
|
|
run $ABRA app deploy "$TEST_APP_DOMAIN" "0.2.0+1.21.0" \
|
|
--no-input --no-converge-checks
|
|
assert_success
|
|
|
|
run $ABRA app upgrade "$TEST_APP_DOMAIN" "0.2.0+1.21.0" \
|
|
--no-input --no-converge-checks --force
|
|
assert_success
|
|
|
|
# current deployment
|
|
assert_output --regexp 'VERSION.*' + "0.2.0+1.21.0"
|
|
assert_output --regexp 'CHAOS.*false'
|
|
|
|
# new deployment
|
|
assert_output --regexp 'VERSION.*' + "0.2.0+1.21.0"
|
|
assert_output --regexp 'CHAOS.*false'
|
|
|
|
# env version
|
|
assert_output --regexp 'CURRENT VERSION.*' + "0.2.0+1.21.0"
|
|
assert_output --regexp 'NEW VERSION.*' + "0.2.0+1.21.0"
|
|
|
|
run grep -q "TYPE=$TEST_RECIPE:0.2.0+1.21.0" \
|
|
"$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
|
|
assert_success
|
|
}
|