Skip to content

Commit e8636b7

Browse files
committed
Add both mergetree and tmprepo for rebase and retarget tests
1 parent ed5a749 commit e8636b7

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

tests/integration/pull_comment_test.go

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313

1414
issues_model "code.gitea.io/gitea/models/issues"
1515
"code.gitea.io/gitea/models/unittest"
16+
"code.gitea.io/gitea/modules/git"
17+
"code.gitea.io/gitea/modules/test"
1618
issues_service "code.gitea.io/gitea/services/issue"
1719

1820
"github.com/stretchr/testify/assert"
@@ -103,7 +105,22 @@ func TestPullComment(t *testing.T) {
103105
testCreateBranch(t, session, "user2", "repo1", "branch/master", "test-branch/retarget", http.StatusSeeOther)
104106
testRepoFork(t, session, "user2", "repo1", "user1", "repo1", "")
105107

106-
t.Run("RebaseComment", func(t *testing.T) { testPullCommentRebase(t, u, session) })
107-
t.Run("RetargetComment", func(t *testing.T) { testPullCommentRetarget(t, u, session) })
108+
t.Run("RebaseComment_MergeTree", func(t *testing.T) {
109+
defer test.MockVariableValue(&git.DefaultFeatures().SupportGitMergeTree, true)()
110+
testPullCommentRebase(t, u, session)
111+
})
112+
t.Run("RebaseComment_TmpRepo", func(t *testing.T) {
113+
defer test.MockVariableValue(&git.DefaultFeatures().SupportGitMergeTree, false)()
114+
testPullCommentRebase(t, u, session)
115+
})
116+
117+
t.Run("RetargetComment_MergeTree", func(t *testing.T) {
118+
defer test.MockVariableValue(&git.DefaultFeatures().SupportGitMergeTree, true)()
119+
testPullCommentRetarget(t, u, session)
120+
})
121+
t.Run("RetargetComment_TmpRepo", func(t *testing.T) {
122+
defer test.MockVariableValue(&git.DefaultFeatures().SupportGitMergeTree, false)()
123+
testPullCommentRetarget(t, u, session)
124+
})
108125
})
109126
}

0 commit comments

Comments
 (0)