diff --git a/tests/integration/app_deploy.bats b/tests/integration/app_deploy.bats index 5828a6b5d3..87c3e79c04 100644 --- a/tests/integration/app_deploy.bats +++ b/tests/integration/app_deploy.bats @@ -75,6 +75,45 @@ teardown(){ assert_success } +# bats test_tags=slow +@test "bail if recipe lint errors and no --chaos" { + # Break the recipe + run sed -i '/traefik.enable=.*/d' "$ABRA_DIR/recipes/$TEST_RECIPE/compose.yml" + assert_success + + # Commit the breakage (so we can test without --chaos) + _set_git_author + + run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" commit -a -m 'Break recipe' + assert_success + + # Make a broken release + run $ABRA recipe sync --patch "$TEST_RECIPE" + run $ABRA recipe release --patch -n "$TEST_RECIPE" + + # Make sure we deploy latest + _wipe_env_version + + run $ABRA app deploy "$TEST_APP_DOMAIN" --no-input + assert_failure + assert_output --partial 'failed lint checks' + + run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" reset --hard HEAD~1 + latestRelease=$(_latest_release) + run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" tag -d "$latestRelease" +} + +# bats test_tags=slow +@test "warn on recipe lint errors with --chaos" { + # Break the recipe + run sed -i '/traefik.enable=.*/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 + assert_output --partial 'failed lint checks' +} + # bats test_tags=slow @test "ensure recipe up to date if no --offline" { wantHash=$(_get_n_hash 3) @@ -147,16 +186,6 @@ teardown(){ assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE" } -@test "no deploy if lint error" { - run sed -i '/traefik.enable=.*/d' "$ABRA_DIR/recipes/$TEST_RECIPE/compose.yml" - assert_success - - run $ABRA app deploy "$TEST_APP_DOMAIN" \ - --no-input --no-converge-checks --chaos - assert_failure - assert_output --partial 'failed lint checks' -} - # bats test_tags=slow @test "error if already deployed and no --force/--chaos" { _deploy_app