diff --git a/tests/integration/app_deploy.bats b/tests/integration/app_deploy.bats index 43c0a9f8..17a75eeb 100644 --- a/tests/integration/app_deploy.bats +++ b/tests/integration/app_deploy.bats @@ -174,6 +174,23 @@ teardown(){ assert_output --partial "${wantHash:0:8}" } +# bats test_tags=slow +@test "bail if env has a hash but no --chaos" { + wantHash=$(_get_n_hash 3) + + run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" reset --hard HEAD~3 + assert_success + + assert_equal $(_get_current_hash) "$wantHash" + + _ensure_env_version "$wantHash" + + run $ABRA app deploy "$TEST_APP_DOMAIN" \ + --no-input --no-converge-checks + assert_failure + assert_output --partial "chaos commit" +} + # bats test_tags=slow @test "retrieve recipe if missing" { run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE" diff --git a/tests/integration/helpers/recipe.bash b/tests/integration/helpers/recipe.bash index bbd68342..4d430cd6 100644 --- a/tests/integration/helpers/recipe.bash +++ b/tests/integration/helpers/recipe.bash @@ -30,7 +30,7 @@ _ensure_catalogue(){ } _ensure_env_version(){ - run sed -i 's/TYPE=abra-test-recipe:.*/TYPE=abra-test-recipe:$1/g' \ + run sed -i "s/TYPE=abra-test-recipe:.*/TYPE=abra-test-recipe:$1/g" \ "$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env" assert_success }