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.

26 lines
531 B

  1. package models
  2. import (
  3. "fmt"
  4. "os"
  5. "path/filepath"
  6. "testing"
  7. "code.gitea.io/gitea/modules/setting"
  8. )
  9. func TestMain(m *testing.M) {
  10. if err := CreateTestEngine(); err != nil {
  11. fmt.Printf("Error creating test engine: %v\n", err)
  12. os.Exit(1)
  13. }
  14. setting.AppURL = "https://try.gitea.io/"
  15. setting.RunUser = "runuser"
  16. setting.SSH.Port = 3000
  17. setting.SSH.Domain = "try.gitea.io"
  18. setting.RepoRootPath = filepath.Join(os.TempDir(), "repos")
  19. setting.AppDataPath = filepath.Join(os.TempDir(), "appdata")
  20. os.Exit(m.Run())
  21. }