diff options
Diffstat (limited to 'services/webhook/main_test.go')
-rw-r--r-- | services/webhook/main_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/services/webhook/main_test.go b/services/webhook/main_test.go new file mode 100644 index 0000000..756b9db --- /dev/null +++ b/services/webhook/main_test.go @@ -0,0 +1,26 @@ +// Copyright 2019 The Gitea Authors. All rights reserved. +// SPDX-License-Identifier: MIT + +package webhook + +import ( + "testing" + + "code.gitea.io/gitea/models/unittest" + "code.gitea.io/gitea/modules/hostmatcher" + "code.gitea.io/gitea/modules/setting" + + _ "code.gitea.io/gitea/models" + _ "code.gitea.io/gitea/models/actions" +) + +func TestMain(m *testing.M) { + // for tests, allow only loopback IPs + setting.Webhook.AllowedHostList = hostmatcher.MatchBuiltinLoopback + unittest.MainTest(m, &unittest.TestOptions{ + SetUp: func() error { + setting.LoadQueueSettings() + return Init() + }, + }) +} |