Browse Source

update travis

pull/90/head
yedf2 4 years ago
parent
commit
387488048f
  1. 2
      .travis.yml
  2. 31
      test/main_test.go

2
.travis.yml

@ -13,6 +13,6 @@ services:
- redis-server
before_install:
- go get -t -v ./...
- go get github.com/mattn/goveralls
- go get github.com/yedf2/goveralls
script:
- $GOPATH/bin/goveralls -service=travis-ci -ignore="examples/*,dtmgrpc/dtmgimp/*.pb.go,bench/*,test/*"

31
test/main_test.go

@ -39,25 +39,22 @@ func TestMain(m *testing.M) {
app.POST(examples.BusiAPI+"/TccBSleepCancel", common.WrapHandler(func(c *gin.Context) (interface{}, error) {
return disorderHandler(c)
}))
config.Store.Driver = "redis"
config.Store.Host = "localhost"
config.Store.Port = 6379
dtmsvr.PopulateDB(false)
examples.PopulateDB(false)
exitIf(m.Run())
config.Store.Driver = "boltdb"
tenv := os.Getenv("TEST_STORE")
if tenv == "boltdb" {
config.Store.Driver = "boltdb"
} else if tenv == "mysql" {
config.Store.Driver = "mysql"
config.Store.Host = "localhost"
config.Store.Port = 3306
config.Store.User = "root"
config.Store.Password = ""
} else {
config.Store.Driver = "redis"
config.Store.Host = "localhost"
config.Store.Port = 6379
}
dtmsvr.PopulateDB(false)
examples.PopulateDB(false)
exitIf(m.Run())
config.Store.Driver = "mysql"
config.Store.Host = "localhost"
config.Store.Port = 3306
config.Store.User = "root"
config.Store.Password = ""
dtmsvr.PopulateDB(false)
examples.PopulateDB(false)
exitIf(m.Run())
}

Loading…
Cancel
Save