Skip to content

Commit 2665c71

Browse files
committed
Add test.
1 parent 252c171 commit 2665c71

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

tests/integrations/github/cicd/test_github_controller.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,21 @@ def test_deploy_to_prod_merge_error(github_client, make_controller):
460460
controller.deploy_to_prod()
461461

462462

463+
def test_deploy_to_prod_blocked_pr(github_client, make_controller):
464+
mock_pull_request = github_client.get_repo().get_pull()
465+
mock_pull_request.merged = False
466+
controller = make_controller(
467+
"tests/fixtures/github/pull_request_synchronized.json",
468+
github_client,
469+
merge_state_status=MergeStateStatus.BLOCKED,
470+
)
471+
with pytest.raises(
472+
Exception,
473+
match=r"^Merge commit cannot be cleanly created. Likely missing CODEOWNERS approval.*",
474+
):
475+
controller.deploy_to_prod()
476+
477+
463478
def test_deploy_to_prod_dirty_pr(github_client, make_controller):
464479
mock_pull_request = github_client.get_repo().get_pull()
465480
mock_pull_request.merged = False
@@ -468,7 +483,10 @@ def test_deploy_to_prod_dirty_pr(github_client, make_controller):
468483
github_client,
469484
merge_state_status=MergeStateStatus.DIRTY,
470485
)
471-
with pytest.raises(Exception, match=r"^Merge commit cannot be cleanly created.*"):
486+
with pytest.raises(
487+
Exception,
488+
match=r"^Merge commit cannot be cleanly created. Likely from a merge conflict.*",
489+
):
472490
controller.deploy_to_prod()
473491

474492

0 commit comments

Comments
 (0)