Merge setting.InitXXX into one function with options (#24389)

This PR will merge 3 Init functions on setting packages as 1 and
introduce an options struct.
This commit is contained in:
Lunny Xiao authored and GitHub committed 2023-05-04 11:55:35 +08:00
1 parent a2fe68e50b
commit 377a0a20f0
28 files changed
+104 -137

No files matched your search

+4 -4
View File
@@ -15,13 +15,13 @@ import (
)
func TestMain(m *testing.M) {
setting.InitProviderAndLoadCommonSettingsForTest()
setting.LoadQueueSettings()
// for tests, allow only loopback IPs
setting.Webhook.AllowedHostList = hostmatcher.MatchBuiltinLoopback
unittest.MainTest(m, &unittest.TestOptions{
GiteaRootPath: filepath.Join("..", ".."),
SetUp: Init,
SetUp: func() error {
setting.LoadQueueSettings()
return Init()
},
})
}