Update test script

This commit is contained in:
Jinzhu 2020-06-24 19:09:19 +08:00
parent 630f4fe03f
commit 6b92bca664
2 changed files with 8 additions and 10 deletions

View File

@ -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")

View File

@ -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