Skip to content

Commit 9d5aa45

Browse files
committed
fix bug
1 parent 4112380 commit 9d5aa45

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

routers/api/v1/repo/main_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@ import (
99
"testing"
1010

1111
"code.gitea.io/gitea/models/unittest"
12+
"code.gitea.io/gitea/modules/setting"
13+
webhook_service "code.gitea.io/gitea/services/webhook"
1214
)
1315

1416
func TestMain(m *testing.M) {
17+
setting.LoadForTest()
1518
unittest.MainTest(m, &unittest.TestOptions{
1619
GiteaRootPath: filepath.Join("..", "..", "..", ".."),
20+
SetUp: func() error {
21+
return webhook_service.Init()
22+
},
1723
})
1824
}

services/webhook/main_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ import (
99
"testing"
1010

1111
"code.gitea.io/gitea/models/unittest"
12+
webhook_service "code.gitea.io/gitea/services/webhook"
1213

1314
_ "code.gitea.io/gitea/models"
1415
)
1516

1617
func TestMain(m *testing.M) {
1718
unittest.MainTest(m, &unittest.TestOptions{
1819
GiteaRootPath: filepath.Join("..", ".."),
20+
SetUp: func() error {
21+
return webhook_service.Init()
22+
},
1923
})
2024
}

0 commit comments

Comments
 (0)