diff --git a/tests/integration/compare_test.go b/tests/integration/compare_test.go index c2cc3b43f6..1f237c1ce2 100644 --- a/tests/integration/compare_test.go +++ b/tests/integration/compare_test.go @@ -175,7 +175,7 @@ func TestCompareCodeExpand(t *testing.T) { user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) session = loginUser(t, user2.Name) - testRepoFork(t, session, user1.Name, repo.Name, user2.Name, "test_blob_excerpt-fork", "") + testRepoFork(t, session, repo.GroupID, user1.Name, repo.Name, user2.Name, "test_blob_excerpt-fork", "") testCreateBranch(t, session, user2.Name, "test_blob_excerpt-fork", "branch/main", "forked-branch", http.StatusSeeOther) testEditFile(t, session, repo.GroupID, user2.Name, "test_blob_excerpt-fork", "forked-branch", "README.md", strings.Repeat("a\n", 15)+"CHANGED\n"+strings.Repeat("a\n", 15)) diff --git a/tests/integration/pull_compare_test.go b/tests/integration/pull_compare_test.go index 6d15af4943..95cf457799 100644 --- a/tests/integration/pull_compare_test.go +++ b/tests/integration/pull_compare_test.go @@ -96,7 +96,7 @@ func TestPullCompare_EnableAllowEditsFromMaintainer(t *testing.T) { // user4 forks repo3 user4Session := loginUser(t, "user4") forkedRepoName := "user4-forked-repo3" - testRepoFork(t, user4Session, repo3.OwnerName, repo3.Name, 0, "user4", forkedRepoName, "") + testRepoFork(t, user4Session, repo3.GroupID, repo3.OwnerName, repo3.Name, "user4", forkedRepoName, "") forkedRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{OwnerName: "user4", Name: forkedRepoName}) assert.True(t, forkedRepo.IsPrivate) diff --git a/tests/integration/pull_create_test.go b/tests/integration/pull_create_test.go index 2bd5d36ceb..ebeb8d5608 100644 --- a/tests/integration/pull_create_test.go +++ b/tests/integration/pull_create_test.go @@ -427,7 +427,7 @@ func TestCreatePullWhenBlocked(t *testing.T) { // Setup // User1 forks repo1 from User2 sessionFork := loginUser(t, ForkOwner) - testRepoFork(t, sessionFork, RepoOwner, "repo1", ForkOwner, "forkrepo1", "") + testRepoFork(t, sessionFork, 0, RepoOwner, "repo1", ForkOwner, "forkrepo1", "") // 1. User2 blocks user1 // sessionBase := loginUser(t, "user2") diff --git a/tests/integration/pull_review_test.go b/tests/integration/pull_review_test.go index b13b36e322..5da4b71801 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, "user2", "repo1", "user1", "repo1", "") + testRepoFork(t, user1Session, 0, "repo1", "user1", "repo1", "user2", "") t.Run("Submit approve/reject review on merged PR", func(t *testing.T) { // Create a merged PR (made by user1) in the upstream repo1. diff --git a/tests/integration/repo_branch_test.go b/tests/integration/repo_branch_test.go index 967d336a8f..3bfe75aac1 100644 --- a/tests/integration/repo_branch_test.go +++ b/tests/integration/repo_branch_test.go @@ -241,7 +241,7 @@ func TestRecentlyPushedNewBranches(t *testing.T) { prepareRecentlyPushedBranchSpecialTest(t, user12Session, repo10, repo10) // create a fork repo in public org - testRepoFork(t, user12Session, 0, repo10.Name, "org25", "org25_fork_repo10", repo10.DefaultBranch, repo10.OwnerName) + testRepoFork(t, user12Session, repo10.GroupID, repo10.OwnerName, repo10.Name, "org25", "org25_fork_repo10", repo10.DefaultBranch) orgPublicForkRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{OwnerID: 25, Name: "org25_fork_repo10"}) prepareRepoPR(t, user12Session, user12Session, repo10, orgPublicForkRepo) prepareRecentlyPushedBranchTest(t, user12Session, repo10, orgPublicForkRepo) diff --git a/tests/integration/repo_fork_test.go b/tests/integration/repo_fork_test.go index 34a3641b10..88968a0415 100644 --- a/tests/integration/repo_fork_test.go +++ b/tests/integration/repo_fork_test.go @@ -21,7 +21,7 @@ import ( "github.com/stretchr/testify/assert" ) -func testRepoFork(t *testing.T, session *TestSession, groupID int64, repoName, forkOwnerName, forkRepoName, forkBranch, ownerName string) *httptest.ResponseRecorder { +func testRepoFork(t *testing.T, session *TestSession, groupID int64, ownerName, repoName, forkOwnerName, forkRepoName, forkBranch string) *httptest.ResponseRecorder { forkOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{Name: forkOwnerName}) // Step0: check the existence of the to-fork repo diff --git a/tests/integration/repo_generate_test.go b/tests/integration/repo_generate_test.go index b1ade20202..be4d5a036b 100644 --- a/tests/integration/repo_generate_test.go +++ b/tests/integration/repo_generate_test.go @@ -61,7 +61,7 @@ func testRepoGenerate(t *testing.T, session *TestSession, templateID, templateOw body := fmt.Sprintf(`# %s Readme Owner: %s Link: /%s/%s -Clone URL: %s/%s.git`, +Clone URL: %s%s/%s.git`, generateRepoName, strings.ToUpper(generateOwnerName), generateOwnerName,