service_test.go 589 B

123456789101112131415161718192021222324252627282930313233343536
  1. package service
  2. import (
  3. "flag"
  4. "path/filepath"
  5. "testing"
  6. "time"
  7. "go-common/app/job/main/growup/conf"
  8. "go-common/app/job/main/growup/service/ctrl"
  9. . "github.com/smartystreets/goconvey/convey"
  10. )
  11. func Test_Temp(t *testing.T) {
  12. Convey("temp test", t, func() {})
  13. }
  14. var (
  15. srv *Service
  16. )
  17. func init() {
  18. dir, _ := filepath.Abs("../cmd/growup-job.toml")
  19. flag.Set("conf", dir)
  20. conf.Init()
  21. srv = New(conf.Conf, ctrl.NewUnboundedExecutor())
  22. time.Sleep(time.Second)
  23. }
  24. func WithService(f func(s *Service)) func() {
  25. return func() {
  26. // Reset(func() { CleanCache() })
  27. f(srv)
  28. }
  29. }