service_test.go 451 B

12345678910111213141516171819202122232425262728293031323334
  1. package block
  2. import (
  3. "context"
  4. "flag"
  5. "os"
  6. "testing"
  7. "go-common/app/job/main/member/conf"
  8. . "github.com/smartystreets/goconvey/convey"
  9. )
  10. var (
  11. s *Service
  12. c context.Context
  13. )
  14. func TestMain(m *testing.M) {
  15. defer os.Exit(0)
  16. flag.Set("conf", "../cmd/member-job-dev.toml")
  17. var err error
  18. if err = conf.Init(); err != nil {
  19. panic(err)
  20. }
  21. m.Run()
  22. }
  23. func TestService(t *testing.T) {
  24. Convey("", t, func() {
  25. s.Ping(c)
  26. s.Close()
  27. })
  28. }