Skip to content

Commit 32cc184

Browse files
committed
chore: add logging around MR creation/merging
Signed-off-by: Tim Knight <tim.knight1@engineering.digital.dwp.gov.uk>
1 parent 1bccbb7 commit 32cc184

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tests/functional/cli/test_cli_repository.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import logging
23
import time
34

45

@@ -76,6 +77,7 @@ def test_commit_merge_requests(gitlab_cli, project, merge_request, wait_for_side
7677
"""This tests the `project-commit merge-requests` command and also tests
7778
that we can print the result using the `json` formatter"""
7879
# Merge the MR first
80+
logging.info(f"MR status: {merge_request.state}")
7981
merge_result = merge_request.merge(should_remove_source_branch=True)
8082
wait_for_sidekiq(timeout=60)
8183

tests/functional/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ def _make_merge_request(*, source_branch: str, create_pipeline: bool = False):
410410
assert result is True, "sidekiq process should have terminated but did not"
411411

412412
project.refresh() # Gets us the current default branch
413+
logging.info(f"Creating branch {source_branch}")
413414
mr_branch = project.branches.create(
414415
{"branch": source_branch, "ref": project.default_branch}
415416
)
@@ -423,6 +424,10 @@ def _make_merge_request(*, source_branch: str, create_pipeline: bool = False):
423424
"commit_message": "New commit in new branch",
424425
}
425426
)
427+
428+
approval_rules = project.approvals.list()
429+
logging.info(f"MR Approval Rules {approval_rules}")
430+
426431
if create_pipeline:
427432
project.files.create(
428433
{
@@ -438,6 +443,7 @@ def _make_merge_request(*, source_branch: str, create_pipeline: bool = False):
438443
"commit_message": "Add a simple pipeline",
439444
}
440445
)
446+
logging.info(f"Creating merge request for {source_branch}")
441447
mr = project.mergerequests.create(
442448
{
443449
"source_branch": source_branch,

0 commit comments

Comments
 (0)