Skip to content

Commit d67b180

Browse files
committed
chore: make test file and commit names unique(r)
Signed-off-by: Tim Knight <tim.knight1@engineering.digital.dwp.gov.uk>
1 parent 2643107 commit d67b180

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

tests/functional/api/test_merge_requests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_merge_requests(project):
1616
}
1717
)
1818

19-
source_branch = "branch1"
19+
source_branch = "branch-merge-request-api"
2020
project.branches.create({"branch": source_branch, "ref": "main"})
2121

2222
project.files.create(
@@ -28,7 +28,7 @@ def test_merge_requests(project):
2828
}
2929
)
3030
project.mergerequests.create(
31-
{"source_branch": "branch1", "target_branch": "main", "title": "MR readme2"}
31+
{"source_branch": source_branch, "target_branch": "main", "title": "MR readme2"}
3232
)
3333

3434

tests/functional/cli/test_cli_repository.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@ def test_list_all_commits(gitlab_cli, project):
3232
data = {
3333
"branch": "new-branch",
3434
"start_branch": "main",
35-
"commit_message": "New commit on new branch",
35+
"commit_message": "chore: test commit on new branch",
3636
"actions": [
37-
{"action": "create", "file_path": "new-file", "content": "new content"}
37+
{
38+
"action": "create",
39+
"file_path": "test-cli-repo.md",
40+
"content": "new content",
41+
}
3842
],
3943
}
4044
commit = project.commits.create(data)

tests/functional/cli/test_cli_v4.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import time
44
from datetime import date
55

6+
branch = "branch-cli-v4"
7+
68

79
def test_create_project(gitlab_cli):
810
name = "test-project1"
@@ -195,8 +197,6 @@ def test_create_issue_note(gitlab_cli, issue):
195197

196198

197199
def test_create_branch(gitlab_cli, project):
198-
branch = "branch1"
199-
200200
cmd = [
201201
"project-branch",
202202
"create",
@@ -213,7 +213,6 @@ def test_create_branch(gitlab_cli, project):
213213

214214

215215
def test_create_merge_request(gitlab_cli, project):
216-
branch = "branch1"
217216

218217
cmd = [
219218
"project-merge-request",
@@ -237,12 +236,12 @@ def test_accept_request_merge(gitlab_cli, project, wait_for_sidekiq):
237236
mr = project.mergerequests.list()[0]
238237
file_data = {
239238
"branch": mr.source_branch,
240-
"file_path": "README2",
239+
"file_path": "test-cli-v4.md",
241240
"content": "Content",
242-
"commit_message": "Pre-merge commit",
241+
"commit_message": "chore: test-cli-v4 change",
243242
}
244243
project.files.create(file_data)
245-
time.sleep(5)
244+
time.sleep(30)
246245
wait_for_sidekiq(timeout=60)
247246

248247
logging.info(f"MR status: {mr.state}")
@@ -501,9 +500,6 @@ def test_delete_project_variable(gitlab_cli, variable):
501500

502501

503502
def test_delete_branch(gitlab_cli, project):
504-
# TODO: branch fixture
505-
branch = "branch1"
506-
507503
cmd = ["project-branch", "delete", "--project-id", project.id, "--name", branch]
508504
ret = gitlab_cli(cmd)
509505

0 commit comments

Comments
 (0)