code.gitea.io/gitea@v1.21.7/services/webhook/main_test.go (about) 1 // Copyright 2019 The Gitea Authors. All rights reserved. 2 // SPDX-License-Identifier: MIT 3 4 package webhook 5 6 import ( 7 "path/filepath" 8 "testing" 9 10 "code.gitea.io/gitea/models/unittest" 11 "code.gitea.io/gitea/modules/hostmatcher" 12 "code.gitea.io/gitea/modules/setting" 13 14 _ "code.gitea.io/gitea/models" 15 _ "code.gitea.io/gitea/models/actions" 16 ) 17 18 func TestMain(m *testing.M) { 19 // for tests, allow only loopback IPs 20 setting.Webhook.AllowedHostList = hostmatcher.MatchBuiltinLoopback 21 unittest.MainTest(m, &unittest.TestOptions{ 22 GiteaRootPath: filepath.Join("..", ".."), 23 SetUp: func() error { 24 setting.LoadQueueSettings() 25 return Init() 26 }, 27 }) 28 }