service_test.go 632 B

123456789101112131415161718192021222324252627282930
  1. package favorite
  2. import (
  3. "flag"
  4. "os"
  5. "testing"
  6. "go-common/app/interface/main/app-interface/conf"
  7. )
  8. func TestMain(m *testing.M) {
  9. if os.Getenv("DEPLOY_ENV") != "" {
  10. flag.Set("app_id", "main.app-svr.app-interface")
  11. flag.Set("conf_token", "1mWvdEwZHmCYGoXJCVIdszBOPVdtpXb3")
  12. flag.Set("tree_id", "2688")
  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. }
  20. flag.Parse()
  21. if err := conf.Init(); err != nil {
  22. panic(err)
  23. }
  24. s = New(conf.Conf)
  25. m.Run()
  26. os.Exit(0)
  27. }