service_test.go 532 B

123456789101112131415161718192021222324252627282930313233
  1. package charge
  2. import (
  3. "context"
  4. "flag"
  5. "path/filepath"
  6. "testing"
  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. var (
  12. s *Service
  13. )
  14. func init() {
  15. dir, _ := filepath.Abs("../../cmd/growup-job.toml")
  16. flag.Set("conf", dir)
  17. conf.Init()
  18. if s == nil {
  19. s = New(conf.Conf, ctrl.NewUnboundedExecutor())
  20. }
  21. }
  22. func TestPing(t *testing.T) {
  23. Convey("Test_Ping", t, func() {
  24. err := s.Ping(context.Background())
  25. So(err, ShouldBeNil)
  26. })
  27. }