dao_test.go 676 B

123456789101112131415161718192021222324252627282930
  1. package track
  2. import (
  3. "flag"
  4. "go-common/app/admin/main/videoup/conf"
  5. "os"
  6. "testing"
  7. )
  8. func TestMain(m *testing.M) {
  9. if os.Getenv("DEPLOY_ENV") != "" {
  10. flag.Set("app_id", "main.archive.videoup-admin")
  11. flag.Set("conf_token", "gRSfeavV7kJdY9875Gf29pbd2wrdKZ1a")
  12. flag.Set("tree_id", "2307")
  13. flag.Set("conf_version", "docker-1")
  14. flag.Set("deploy_env", "uat")
  15. flag.Set("conf_host", "config.bilibili.co")
  16. flag.Set("conf_path", "/tmp")
  17. flag.Set("region", "sh")
  18. flag.Set("zone", "sh001")
  19. } else {
  20. flag.Set("conf", "../../cmd/videoup-admin.toml")
  21. }
  22. flag.Parse()
  23. if err := conf.Init(); err != nil {
  24. panic(err)
  25. }
  26. d = New(conf.Conf)
  27. os.Exit(m.Run())
  28. }