You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main_test.go 640B

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