Skip to content

Commit 8fbc1e0

Browse files
committed
Fix test
1 parent 1fb7b01 commit 8fbc1e0

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

models/migrations/v1_25/v321_test.go

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"github.com/stretchr/testify/assert"
1414
)
1515

16-
func Test_AddCombinedIndexToIssueUser(t *testing.T) {
16+
func Test_AddBeforeCommitIDForComment(t *testing.T) {
1717
type Comment struct { // old struct
1818
ID int64 `xorm:"pk autoincr"`
1919
Type int `xorm:"INDEX"`
@@ -67,8 +67,36 @@ func Test_AddCombinedIndexToIssueUser(t *testing.T) {
6767
CommentMetaData string `xorm:"JSON TEXT"` // put all non-index metadata in a single field
6868
}
6969

70+
type PullRequest struct {
71+
ID int64 `xorm:"pk autoincr"`
72+
Type int
73+
Status int
74+
ConflictedFiles []string `xorm:"TEXT JSON"`
75+
CommitsAhead int
76+
CommitsBehind int
77+
78+
ChangedProtectedFiles []string `xorm:"TEXT JSON"`
79+
80+
IssueID int64 `xorm:"INDEX"`
81+
Index int64
82+
83+
HeadRepoID int64 `xorm:"INDEX"`
84+
BaseRepoID int64 `xorm:"INDEX"`
85+
HeadBranch string
86+
BaseBranch string
87+
MergeBase string `xorm:"VARCHAR(64)"`
88+
AllowMaintainerEdit bool `xorm:"NOT NULL DEFAULT false"`
89+
90+
HasMerged bool `xorm:"INDEX"`
91+
MergedCommitID string `xorm:"VARCHAR(64)"`
92+
MergerID int64 `xorm:"INDEX"`
93+
MergedUnix timeutil.TimeStamp `xorm:"updated INDEX"`
94+
95+
Flow int `xorm:"NOT NULL DEFAULT 0"`
96+
}
97+
7098
// Prepare and load the testing database
71-
x, deferable := base.PrepareTestEnv(t, 0, new(Comment))
99+
x, deferable := base.PrepareTestEnv(t, 0, new(Comment), new(PullRequest))
72100
defer deferable()
73101

74102
assert.NoError(t, AddBeforeCommitIDForComment(x))

0 commit comments

Comments
 (0)