service_test.go 345 B

12345678910111213141516171819202122
  1. package service
  2. import (
  3. "os"
  4. "testing"
  5. "go-common/app/job/main/dm/conf"
  6. "go-common/library/log"
  7. )
  8. var testSvc *Service
  9. func TestMain(m *testing.M) {
  10. conf.ConfPath = "../cmd/dm-job-test.toml"
  11. if err := conf.Init(); err != nil {
  12. panic(err)
  13. }
  14. log.Init(conf.Conf.Xlog)
  15. defer log.Close()
  16. testSvc = New(conf.Conf)
  17. os.Exit(m.Run())
  18. }