You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
561 B
39 lines
561 B
package service |
|
|
|
import ( |
|
"context" |
|
"flag" |
|
"os" |
|
"path/filepath" |
|
"testing" |
|
|
|
"go-common/app/job/main/dm2/conf" |
|
|
|
. "github.com/smartystreets/goconvey/convey" |
|
) |
|
|
|
var ( |
|
svr *Service |
|
) |
|
|
|
func TestMain(m *testing.M) { |
|
var ( |
|
err error |
|
) |
|
dir, _ := filepath.Abs("../cmd/dm2-job.toml") |
|
if err = flag.Set("conf", dir); err != nil { |
|
panic(err) |
|
} |
|
if err = conf.Init(); err != nil { |
|
panic(err) |
|
} |
|
svr = New(conf.Conf) |
|
os.Exit(m.Run()) |
|
} |
|
|
|
func TestPing(t *testing.T) { |
|
Convey("", t, func() { |
|
err := svr.Ping(context.TODO()) |
|
So(err, ShouldBeNil) |
|
}) |
|
}
|
|
|