multiple databases testes on 1 TestMain
This commit is contained in:
parent
0437b98eca
commit
01c460927d
|
@ -21,9 +21,7 @@ database:
|
||||||
test:
|
test:
|
||||||
override:
|
override:
|
||||||
# './...' is a relative pattern which means all subdirectories
|
# './...' is a relative pattern which means all subdirectories
|
||||||
- go test -v -race -coverprofile=coverage.txt -covermode=atomic
|
- go test -v -race -db="sqlite3;mysql;postgres" -conn_str="./test.db;root:@/xorm_test;dbname=xorm_test sslmode=disable" -coverprofile=coverage.txt -covermode=atomic
|
||||||
- go test -v -race -db=mysql -conn_str="root:@/xorm_test" -coverprofile=coverage.txt -covermode=atomic
|
|
||||||
- go test -v -race -db=postgres -conn_str="dbname=xorm_test sslmode=disable" -coverprofile=coverage.txt -covermode=atomic
|
|
||||||
- cd /home/ubuntu/.go_workspace/src/github.com/go-xorm/tests && ./sqlite3.sh
|
- cd /home/ubuntu/.go_workspace/src/github.com/go-xorm/tests && ./sqlite3.sh
|
||||||
- cd /home/ubuntu/.go_workspace/src/github.com/go-xorm/tests && ./mysql.sh
|
- cd /home/ubuntu/.go_workspace/src/github.com/go-xorm/tests && ./mysql.sh
|
||||||
- cd /home/ubuntu/.go_workspace/src/github.com/go-xorm/tests && ./postgres.sh
|
- cd /home/ubuntu/.go_workspace/src/github.com/go-xorm/tests && ./postgres.sh
|
||||||
|
|
|
@ -78,6 +78,7 @@ func TestMain(m *testing.M) {
|
||||||
dbType = dbs[i]
|
dbType = dbs[i]
|
||||||
connString = conns[i]
|
connString = conns[i]
|
||||||
testEngine = nil
|
testEngine = nil
|
||||||
|
fmt.Println("testing", dbType, connString)
|
||||||
|
|
||||||
if err := prepareEngine(); err != nil {
|
if err := prepareEngine(); err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
|
|
Loading…
Reference in New Issue