Skip to content

Commit

Permalink
test: tidy up functional tests
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Knight <tim.knight1@engineering.digital.dwp.gov.uk>
  • Loading branch information
TimKnight-DWP authored and nejch committed Apr 25, 2024
1 parent 4bef473 commit 06266ea
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/functional/api/test_deploy_tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_project_deploy_tokens(gl, project):

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

Expand Down
3 changes: 3 additions & 0 deletions tests/functional/cli/test_cli_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ def test_list_merge_request_commits(gitlab_cli, merge_request, project):


def test_commit_merge_requests(gitlab_cli, project, merge_request):
"""This tests the `project-commit merge-requests` command and also tests
that we can print the result using the `json` formatter"""

# Pause to let GL catch up (happens on hosted too, sometimes takes a while for server to be ready to merge)
time.sleep(30)

Expand Down
4 changes: 3 additions & 1 deletion tests/functional/cli/test_cli_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import time

branch = "branch-cli-v4"
branch = "BRANCH-cli-v4"


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

mr = project.mergerequests.get(mr.iid)

if mr.detailed_merge_status == "not_approved":
approve_cmd = [
"project-merge-request",
Expand Down
3 changes: 0 additions & 3 deletions tests/functional/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,6 @@ def _make_merge_request(*, source_branch: str, create_pipeline: bool = False):
}
)

# Helps with Debugging why MRs fail to merge resulting in 405 from downstream tests
project.approvalrules.list()

if create_pipeline:
project.files.create(
{
Expand Down

0 comments on commit 06266ea

Please sign in to comment.