mirror of https://github.com/go-gorm/gorm.git
Update test script
This commit is contained in:
parent
4a01d4c263
commit
8ce2dd5548
|
@ -7,6 +7,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestExceptionsWithInvalidSql(t *testing.T) {
|
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
|
var columns []string
|
||||||
if DB.Where("sdsd.zaaa = ?", "sd;;;aa").Pluck("aaa", &columns).Error == nil {
|
if DB.Where("sdsd.zaaa = ?", "sd;;;aa").Pluck("aaa", &columns).Error == nil {
|
||||||
t.Errorf("Should got error with invalid SQL")
|
t.Errorf("Should got error with invalid SQL")
|
||||||
|
|
|
@ -19,27 +19,21 @@ for dialect in "${dialects[@]}" ; do
|
||||||
then
|
then
|
||||||
echo "testing ${dialect}..."
|
echo "testing ${dialect}..."
|
||||||
|
|
||||||
race=""
|
|
||||||
if [ "$GORM_DIALECT" = "sqlserver" ]
|
|
||||||
then
|
|
||||||
race="-race"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$GORM_VERBOSE" = "" ]
|
if [ "$GORM_VERBOSE" = "" ]
|
||||||
then
|
then
|
||||||
GORM_DIALECT=${dialect} go test $race -count=1 ./...
|
GORM_DIALECT=${dialect} go test -race -count=1 ./...
|
||||||
if [ -d tests ]
|
if [ -d tests ]
|
||||||
then
|
then
|
||||||
cd tests
|
cd tests
|
||||||
GORM_DIALECT=${dialect} go test $race -count=1 ./...
|
GORM_DIALECT=${dialect} go test -race -count=1 ./...
|
||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
GORM_DIALECT=${dialect} go test $race -count=1 -v ./...
|
GORM_DIALECT=${dialect} go test -race -count=1 -v ./...
|
||||||
if [ -d tests ]
|
if [ -d tests ]
|
||||||
then
|
then
|
||||||
cd tests
|
cd tests
|
||||||
GORM_DIALECT=${dialect} go test $race -count=1 -v ./...
|
GORM_DIALECT=${dialect} go test -race -count=1 -v ./...
|
||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue