From 8ce2dd5548689f2281e290b80680764e39c4778b Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Wed, 24 Jun 2020 19:09:19 +0800 Subject: [PATCH] Update test script --- tests/main_test.go | 4 ++++ tests/tests_all.sh | 14 ++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/main_test.go b/tests/main_test.go index 9d933caf..5b8c7dbb 100644 --- a/tests/main_test.go +++ b/tests/main_test.go @@ -7,6 +7,10 @@ import ( ) func TestExceptionsWithInvalidSql(t *testing.T) { + if name := DB.Dialector.Name(); name == "sqlserver" { + t.Skip("skip sqlserver due to it will raise data race for invalid sql") + } + var columns []string if DB.Where("sdsd.zaaa = ?", "sd;;;aa").Pluck("aaa", &columns).Error == nil { t.Errorf("Should got error with invalid SQL") diff --git a/tests/tests_all.sh b/tests/tests_all.sh index 47f25401..e87ff045 100755 --- a/tests/tests_all.sh +++ b/tests/tests_all.sh @@ -19,27 +19,21 @@ for dialect in "${dialects[@]}" ; do then echo "testing ${dialect}..." - race="" - if [ "$GORM_DIALECT" = "sqlserver" ] - then - race="-race" - fi - if [ "$GORM_VERBOSE" = "" ] then - GORM_DIALECT=${dialect} go test $race -count=1 ./... + GORM_DIALECT=${dialect} go test -race -count=1 ./... if [ -d tests ] then cd tests - GORM_DIALECT=${dialect} go test $race -count=1 ./... + GORM_DIALECT=${dialect} go test -race -count=1 ./... cd .. fi else - GORM_DIALECT=${dialect} go test $race -count=1 -v ./... + GORM_DIALECT=${dialect} go test -race -count=1 -v ./... if [ -d tests ] then cd tests - GORM_DIALECT=${dialect} go test $race -count=1 -v ./... + GORM_DIALECT=${dialect} go test -race -count=1 -v ./... cd .. fi fi