Skip to content

Commit

Permalink
Setup mssql test env
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhu committed Mar 22, 2017
1 parent 66982a7 commit 403487d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@ func OpenTestConnection() (db *gorm.DB, err error) {
fmt.Println("testing foundation...")
db, err = gorm.Open("foundation", "dbname=gorm port=15432 sslmode=disable")
case "mssql":
// CREATE LOGIN gorm WITH PASSWORD = 'LoremIpsum86';
// CREATE DATABASE gorm;
// USE gorm;
// CREATE USER gorm FROM LOGIN gorm;
// sp_changedbowner 'gorm';
fmt.Println("testing mssql...")
db, err = gorm.Open("mssql", "server=SERVER_HERE;database=rogue;user id=USER_HERE;password=PW_HERE;port=1433")
db, err = gorm.Open("mssql", "sqlserver://gorm:LoremIpsum86@localhost:1433?database=gorm")
default:
fmt.Println("testing sqlite3...")
db, err = gorm.Open("sqlite3", filepath.Join(os.TempDir(), "gorm.db"))
Expand Down
2 changes: 1 addition & 1 deletion test_all.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dialects=("postgres" "mysql" "sqlite")
dialects=("postgres" "mysql" "sqlite" "mssql")

for dialect in "${dialects[@]}" ; do
GORM_DIALECT=${dialect} go test
Expand Down

0 comments on commit 403487d

Please sign in to comment.