From 403487d5dd27789032ae8849c0aafc1be858c1ce Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Wed, 22 Mar 2017 18:01:29 +0800 Subject: [PATCH] Setup mssql test env --- main_test.go | 7 ++++++- test_all.sh | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/main_test.go b/main_test.go index f76988d2..32e8c0c9 100644 --- a/main_test.go +++ b/main_test.go @@ -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")) diff --git a/test_all.sh b/test_all.sh index 6c5593b3..7e752051 100755 --- a/test_all.sh +++ b/test_all.sh @@ -1,4 +1,4 @@ -dialects=("postgres" "mysql" "sqlite") +dialects=("postgres" "mysql" "sqlite" "mssql") for dialect in "${dialects[@]}" ; do GORM_DIALECT=${dialect} go test