-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from getsentry/iw/apply-on-update
Adding implementation for apply_on_update
- Loading branch information
Showing
5 changed files
with
111 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,33 @@ | ||
#!/usr/bin/env py.test | ||
from __future__ import annotations | ||
|
||
from lib.functions import now | ||
from manual_tests.lib import gh | ||
from manual_tests.lib import gha | ||
from manual_tests.lib import slice | ||
from manual_tests.lib import tacos_demo | ||
from manual_tests.lib import tf | ||
|
||
TEST_NAME = __name__ | ||
|
||
Branch = int | ||
|
||
|
||
def test() -> None: | ||
# TODO: anything | ||
pass | ||
tacos_demo.clone() | ||
tacos_demo_pr = tacos_demo.new_pr(TEST_NAME, slice.random()) | ||
try: | ||
since = now() | ||
gha.assert_eventual_success("terraform_lock", since) | ||
|
||
gh.approve_pr(tacos_demo_pr.url) | ||
gh.assert_pr_is_approved(tacos_demo_pr.url) | ||
|
||
# the taco-apply label causes the plan to become clean: | ||
assert not tf.plan_clean() | ||
since = now() | ||
gh.add_label(tacos_demo_pr.url, ":taco::apply") | ||
gha.assert_eventual_success("terraform_apply", since) | ||
assert tf.plan_clean() | ||
finally: | ||
gh.close_pr(tacos_demo_pr.branch) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from __future__ import annotations | ||
|
||
from lib import sh | ||
|
||
|
||
def plan_clean() -> bool: | ||
""" | ||
Returns whether running terraform plan differs from the current state | ||
""" | ||
return sh.success( | ||
("sudo-sac", "terragrunt", "run-all", "plan", "--detailed-exitcode") | ||
) |