Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhu committed Jun 13, 2019
1 parent 321c636 commit ff430ca
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package gorm_test

// Run tests
// $ docker-compose up
// $ ./test_all.sh

import (
"context"
"database/sql"
Expand Down Expand Up @@ -44,13 +48,13 @@ func OpenTestConnection() (db *gorm.DB, err error) {
case "mysql":
fmt.Println("testing mysql...")
if dbDSN == "" {
dbDSN = "gorm:gorm@tcp(localhost:3306)/gorm?charset=utf8&parseTime=True"
dbDSN = "gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True"
}
db, err = gorm.Open("mysql", dbDSN)
case "postgres":
fmt.Println("testing postgres...")
if dbDSN == "" {
dbDSN = "user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable"
dbDSN = "user=gorm password=gorm DB.name=gorm port=9920 sslmode=disable"
}
db, err = gorm.Open("postgres", dbDSN)
case "mssql":
Expand All @@ -61,7 +65,7 @@ func OpenTestConnection() (db *gorm.DB, err error) {
// sp_changedbowner 'gorm';
fmt.Println("testing mssql...")
if dbDSN == "" {
dbDSN = "sqlserver://gorm:LoremIpsum86@localhost:1433?database=gorm"
dbDSN = "sqlserver://gorm:LoremIpsum86@localhost:9930?database=gorm"
}
db, err = gorm.Open("mssql", dbDSN)
default:
Expand Down

0 comments on commit ff430ca

Please sign in to comment.