service_test.go 409 B

12345678910111213141516171819202122232425262728293031
  1. package service
  2. import (
  3. "context"
  4. "flag"
  5. "testing"
  6. "go-common/app/job/main/aegis/conf"
  7. "go-common/library/log"
  8. )
  9. var (
  10. s *Service
  11. )
  12. func initConf() {
  13. if err := conf.Init(); err != nil {
  14. panic(err)
  15. }
  16. log.Init(conf.Conf.Log)
  17. }
  18. func init() {
  19. flag.Set("conf", "../cmd/aegis-job.toml")
  20. initConf()
  21. s = New(conf.Conf)
  22. }
  23. func Test_syncReport(t *testing.T) {
  24. s.syncReport(context.Background())
  25. }