Skip to content

Commit 8ebfe1a

Browse files
committed
test: tidy up functional tests
Signed-off-by: Tim Knight <tim.knight1@engineering.digital.dwp.gov.uk>
1 parent 4d99ee4 commit 8ebfe1a

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

tests/functional/api/test_deploy_tokens.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_project_deploy_tokens(gl, project):
1616

1717
deploy_token = project.deploytokens.get(deploy_token.id)
1818
assert deploy_token.name == "foo"
19-
assert deploy_token.expires_at == today + "T00:00:00.000Z"
19+
assert deploy_token.expires_at == f"{today}T00:00:00.000Z"
2020
assert deploy_token.scopes == ["read_registry"]
2121
assert deploy_token.username == "bar"
2222

tests/functional/cli/test_cli_repository.py

+3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ def test_list_merge_request_commits(gitlab_cli, merge_request, project):
7777

7878

7979
def test_commit_merge_requests(gitlab_cli, project, merge_request):
80+
"""This tests the `project-commit merge-requests` command and also tests
81+
that we can print the result using the `json` formatter"""
82+
8083
# Pause to let GL catch up (happens on hosted too, sometimes takes a while for server to be ready to merge)
8184
time.sleep(30)
8285

tests/functional/cli/test_cli_v4.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
import time
44

5-
branch = "branch-cli-v4"
5+
branch = "BRANCH-cli-v4"
66

77

88
def test_create_project(gitlab_cli):
@@ -243,6 +243,8 @@ def test_accept_request_merge(gitlab_cli, project):
243243
# Pause to let GL catch up (happens on hosted too, sometimes takes a while for server to be ready to merge)
244244
time.sleep(30)
245245

246+
mr = project.mergerequests.get(mr.iid)
247+
246248
if mr.detailed_merge_status == "not_approved":
247249
approve_cmd = [
248250
"project-merge-request",

tests/functional/conftest.py

-3
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,6 @@ def _make_merge_request(*, source_branch: str, create_pipeline: bool = False):
389389
}
390390
)
391391

392-
# Helps with Debugging why MRs fail to merge resulting in 405 from downstream tests
393-
project.approvalrules.list()
394-
395392
if create_pipeline:
396393
project.files.create(
397394
{

0 commit comments

Comments
 (0)