test: int suite fixes

This commit is contained in:
2024-07-17 13:22:14 +02:00
parent e5a6dea10c
commit 8b8e158664
20 changed files with 115 additions and 79 deletions

View File

@ -87,19 +87,18 @@ teardown(){
# bats test_tags=slow
@test "ensure recipe not up to date if --offline" {
wantHash=$(_get_n_hash 3)
_ensure_env_version "0.1.0+1.20.0"
latestRelease=$(_latest_release)
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" reset --hard HEAD~3
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" tag -d "$latestRelease"
assert_success
assert_equal $(_get_current_hash) "$wantHash"
# NOTE(d1): need to use --chaos to force same commit
run $ABRA app deploy "$TEST_APP_DOMAIN" \
--no-input --no-converge-checks --chaos --offline
--no-input --no-converge-checks --offline
assert_success
assert_equal $(_get_current_hash) "$wantHash"
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" tag -l
refute_output --partial "$latestRelease"
}
# bats test_tags=slow
@ -107,6 +106,7 @@ teardown(){
latestCommit="$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" rev-parse --short HEAD)"
_remove_tags
_wipe_env_version
# NOTE(d1): need to pass --offline to stop tags being pulled again
run $ABRA app deploy "$TEST_APP_DOMAIN" \
@ -126,6 +126,8 @@ teardown(){
assert_equal $(_get_current_hash) "$wantHash"
_wipe_env_version
run $ABRA app deploy "$TEST_APP_DOMAIN" \
--no-input --no-converge-checks --chaos
assert_success