Skip to content

Commit

Permalink
fix: e2e tests in safe to apply mode
Browse files Browse the repository at this point in the history
  • Loading branch information
giovannibaratta committed Dec 8, 2023
1 parent c1d1d28 commit 90502f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion e2e-tests/suites/safe_to_apply/decorator/decorator.bats
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ teardown() {

# Expect
[ "$status" -eq 1 ]
# Sanity check
grep "Operating mode: reverse" <<< "$output"
}

@test "should return 0 if the only resource in the plan is safe to apply" {
Expand All @@ -39,8 +41,10 @@ teardown() {
terraform show -json test.tfplan > ${BATS_TEST_TMPDIR}/test.tfplan.json

# When
run "/code/terraapprove" "." "./test.tfplan.json"
run "/code/terraapprove" "." "./test.tfplan.json" "--reverse"

# Expect
[ "$status" -eq 0 ]
# Sanity check
grep "Operating mode: reverse" <<< "$output"
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ teardown() {
terraform show -json test.tfplan > ${BATS_TEST_TMPDIR}/test.tfplan.json

# When
run "/code/terraapprove" "." "./test.tfplan.json"
run "/code/terraapprove" "." "./test.tfplan.json" "--reverse"

# Expect
[ "$status" -eq 0 ]
# Sanity check
grep "Operating mode: reverse" <<< "$output"
}

0 comments on commit 90502f3

Please sign in to comment.