From 60fd4472fdc65d9255f2530e2a634c082230a47c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Tue, 25 Nov 2025 21:49:33 -0500 Subject: [PATCH] more test fixes --- tests/integration/editor_test.go | 2 +- tests/integration/pull_compare_test.go | 15 ++++++++------- tests/integration/pull_create_test.go | 19 ++++++++++--------- tests/integration/pull_review_test.go | 2 +- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/tests/integration/editor_test.go b/tests/integration/editor_test.go index 990219a0af..3a5d0d51b5 100644 --- a/tests/integration/editor_test.go +++ b/tests/integration/editor_test.go @@ -125,7 +125,7 @@ func testEditorActionEdit(t *testing.T, session *TestSession, groupID int64, use resp := testEditorActionPostRequest(t, session, fmt.Sprintf("/%s/%s%s/%s/%s/%s", user, maybeGroupSegment(groupID), repo, editorAction, branch, filePath), params) assert.Equal(t, http.StatusOK, resp.Code) assert.NotEmpty(t, test.RedirectURL(resp)) - req := NewRequest(t, "GET", path.Join(user, repo, "raw/branch", newBranchName, params["tree_path"])) + req := NewRequest(t, "GET", path.Join(user, maybeGroupSegment(groupID), repo, "raw/branch", newBranchName, params["tree_path"])) resp = session.MakeRequest(t, req, http.StatusOK) assert.Equal(t, params["content"], resp.Body.String()) return resp diff --git a/tests/integration/pull_compare_test.go b/tests/integration/pull_compare_test.go index 95cf457799..9308876929 100644 --- a/tests/integration/pull_compare_test.go +++ b/tests/integration/pull_compare_test.go @@ -103,13 +103,14 @@ func TestPullCompare_EnableAllowEditsFromMaintainer(t *testing.T) { // user4 creates a new branch and a PR testEditFileToNewBranch(t, user4Session, 0, "user4", forkedRepoName, "master", "user4/update-readme", "README.md", "Hello, World\n(Edited by user4)\n") resp := testPullCreateDirectly(t, user4Session, createPullRequestOptions{ - BaseRepoOwner: repo3.OwnerName, - BaseRepoName: repo3.Name, - BaseBranch: "master", - HeadRepoOwner: "user4", - HeadRepoName: forkedRepoName, - HeadBranch: "user4/update-readme", - Title: "PR for user4 forked repo3", + BaseRepoOwner: repo3.OwnerName, + BaseRepoName: repo3.Name, + BaseRepoGroupID: repo3.GroupID, + BaseBranch: "master", + HeadRepoOwner: "user4", + HeadRepoName: forkedRepoName, + HeadBranch: "user4/update-readme", + Title: "PR for user4 forked repo3", }) prURL := test.RedirectURL(resp) diff --git a/tests/integration/pull_create_test.go b/tests/integration/pull_create_test.go index 80f2936776..b62af0d400 100644 --- a/tests/integration/pull_create_test.go +++ b/tests/integration/pull_create_test.go @@ -65,14 +65,15 @@ func testPullCreate(t *testing.T, session *TestSession, user, repo string, toSel } type createPullRequestOptions struct { - BaseRepoOwner string - BaseRepoName string - BaseBranch string - HeadRepoOwner string - HeadRepoName string - HeadBranch string - Title string - ReviewerIDs string // comma-separated list of user IDs + BaseRepoOwner string + BaseRepoName string + BaseRepoGroupID int64 + BaseBranch string + HeadRepoOwner string + HeadRepoName string + HeadBranch string + Title string + ReviewerIDs string // comma-separated list of user IDs } func (opts createPullRequestOptions) IsValid() bool { @@ -93,7 +94,7 @@ func testPullCreateDirectly(t *testing.T, session *TestSession, opts createPullR headCompare = fmt.Sprintf("%s:%s", opts.HeadRepoOwner, opts.HeadBranch) } } - req := NewRequest(t, "GET", fmt.Sprintf("/%s/%s/compare/%s...%s", opts.BaseRepoOwner, opts.BaseRepoName, opts.BaseBranch, headCompare)) + req := NewRequest(t, "GET", fmt.Sprintf("/%s/%s%s/compare/%s...%s", opts.BaseRepoOwner, maybeGroupSegment(opts.BaseRepoGroupID), opts.BaseRepoName, opts.BaseBranch, headCompare)) resp := session.MakeRequest(t, req, http.StatusOK) // Submit the form for creating the pull diff --git a/tests/integration/pull_review_test.go b/tests/integration/pull_review_test.go index e602ce23a0..f03b2c0d93 100644 --- a/tests/integration/pull_review_test.go +++ b/tests/integration/pull_review_test.go @@ -220,7 +220,7 @@ func TestPullView_GivenApproveOrRejectReviewOnClosedPR(t *testing.T) { user2Session := loginUser(t, "user2") // Have user1 create a fork of repo1. - testRepoFork(t, user1Session, 0, "user1", "repo1", "user2", "repo1", "") + testRepoFork(t, user1Session, 0, "user2", "repo1", "user1", "repo1", "") t.Run("Submit approve/reject review on merged PR", func(t *testing.T) { // Create a merged PR (made by user1) in the upstream repo1.