Skip to content

Commit 053817a

Browse files
committed
Fix test
1 parent 562ab41 commit 053817a

File tree

1 file changed

+36
-8
lines changed

1 file changed

+36
-8
lines changed

tests/integration/pull_status_test.go

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,15 @@ func testPullRequestStatusCheckingMergeable(t *testing.T) {
180180
testCreateFile(t, session, baseRepo.OwnerName, baseRepo.Name, "main", "important-secrets", "important_file", "Just a non-important file")
181181

182182
// create Pull to merge the important-secrets branch into main branch.
183-
resp := testPullCreateDirectly(t, session, baseRepo.OwnerName, baseRepo.Name, "main",
184-
baseRepo.OwnerName, baseRepo.Name, "important-secrets", "PR with no conflict")
183+
resp := testPullCreateDirectly(t, session, createPullRequestOptions{
184+
BaseRepoOwner: baseRepo.OwnerName,
185+
BaseRepoName: baseRepo.Name,
186+
BaseBranch: "main",
187+
HeadRepoOwner: baseRepo.OwnerName,
188+
HeadRepoName: baseRepo.Name,
189+
HeadBranch: "important-secrets",
190+
Title: "PR with no conflict",
191+
})
185192
// check the redirected URL
186193
url := test.RedirectURL(resp)
187194
assert.Regexp(t, fmt.Sprintf("^/%s/pulls/[0-9]*$", baseRepo.FullName()), url)
@@ -234,8 +241,15 @@ func testPullRequestStatusCheckingConflicted(t *testing.T) {
234241
testCreateFile(t, session, baseRepo.OwnerName, baseRepo.Name, "main", "main", "important_file", "Not the same content :P")
235242

236243
// create Pull to merge the important-secrets branch into main branch.
237-
resp := testPullCreateDirectly(t, session, baseRepo.OwnerName, baseRepo.Name, "main",
238-
baseRepo.OwnerName, baseRepo.Name, "important-secrets", "PR with conflict!")
244+
resp := testPullCreateDirectly(t, session, createPullRequestOptions{
245+
BaseRepoOwner: baseRepo.OwnerName,
246+
BaseRepoName: baseRepo.Name,
247+
BaseBranch: "main",
248+
HeadRepoOwner: baseRepo.OwnerName,
249+
HeadRepoName: baseRepo.Name,
250+
HeadBranch: "important-secrets",
251+
Title: "PR with conflict!",
252+
})
239253
// check the redirected URL
240254
url := test.RedirectURL(resp)
241255
assert.Regexp(t, fmt.Sprintf("^/%s/pulls/[0-9]*$", baseRepo.FullName()), url)
@@ -289,8 +303,15 @@ func testPullRequestStatusCheckingCrossRepoMergeable(t *testing.T, giteaURL *url
289303
testCreateFile(t, session, forkRepo.OwnerName, forkRepo.Name, "main", "important-secrets", "important_file", "Just a non-important file")
290304

291305
// create Pull to merge the important-secrets branch into main branch.
292-
resp := testPullCreateDirectly(t, session, baseRepo.OwnerName, baseRepo.Name, "main",
293-
forkRepo.OwnerName, forkRepo.Name, "important-secrets", "PR with no conflict")
306+
resp := testPullCreateDirectly(t, session, createPullRequestOptions{
307+
BaseRepoOwner: baseRepo.OwnerName,
308+
BaseRepoName: baseRepo.Name,
309+
BaseBranch: "main",
310+
HeadRepoOwner: forkRepo.OwnerName,
311+
HeadRepoName: forkRepo.Name,
312+
HeadBranch: "important-secrets",
313+
Title: "PR with no conflict",
314+
})
294315
// check the redirected URL
295316
url := test.RedirectURL(resp)
296317
assert.Regexp(t, fmt.Sprintf("^/%s/pulls/[0-9]*$", baseRepo.FullName()), url)
@@ -347,8 +368,15 @@ func testPullRequestStatusCheckingCrossRepoConflicted(t *testing.T, giteaURL *ur
347368
testCreateFile(t, session, baseRepo.OwnerName, baseRepo.Name, "main", "main", "important_file", "Not the same content :P")
348369

349370
// create Pull to merge the important-secrets branch into main branch.
350-
resp := testPullCreateDirectly(t, session, baseRepo.OwnerName, baseRepo.Name, "main",
351-
forkRepo.OwnerName, forkRepo.Name, "important-secrets", "PR with conflict!")
371+
resp := testPullCreateDirectly(t, session, createPullRequestOptions{
372+
BaseRepoOwner: baseRepo.OwnerName,
373+
BaseRepoName: baseRepo.Name,
374+
BaseBranch: "main",
375+
HeadRepoOwner: forkRepo.OwnerName,
376+
HeadRepoName: forkRepo.Name,
377+
HeadBranch: "important-secrets",
378+
Title: "PR with conflict!",
379+
})
352380
// check the redirected URL
353381
url := test.RedirectURL(resp)
354382
assert.Regexp(t, fmt.Sprintf("^/%s/pulls/[0-9]*$", baseRepo.FullName()), url)

0 commit comments

Comments
 (0)