Merge pull request #1316 from bradrydzewski/master

fix database unit tests in Makefile
This commit is contained in:
Brad Rydzewski 2015-11-11 15:22:51 -08:00
commit 3a84a86dca
2 changed files with 3 additions and 3 deletions

View file

@ -44,11 +44,11 @@ test:
# docker run --publish=3306:3306 -e MYSQL_DATABASE=test -e MYSQL_ALLOW_EMPTY_PASSWORD=yes mysql:5.6.27 # docker run --publish=3306:3306 -e MYSQL_DATABASE=test -e MYSQL_ALLOW_EMPTY_PASSWORD=yes mysql:5.6.27
test_mysql: test_mysql:
DATABASE_DRIVER="mysql" DATABASE_CONFIG="root@tcp(127.0.0.1:3306)/test?parseTime=true" go test github.com/drone/drone/model DATABASE_DRIVER="mysql" DATABASE_CONFIG="root@tcp(127.0.0.1:3306)/test?parseTime=true" go test github.com/drone/drone/store/datastore
# docker run --publish=5432:5432 postgres:9.4.5 # docker run --publish=5432:5432 postgres:9.4.5
test_postgres: test_postgres:
DATABASE_DRIVER="postgres" DATABASE_CONFIG="host=127.0.0.1 user=postgres dbname=postgres sslmode=disable" go test github.com/drone/drone/model DATABASE_DRIVER="postgres" DATABASE_CONFIG="host=127.0.0.1 user=postgres dbname=postgres sslmode=disable" go test github.com/drone/drone/store/datastore
deb: deb:
mkdir -p contrib/debian/drone/usr/local/bin mkdir -p contrib/debian/drone/usr/local/bin

View file

@ -47,7 +47,7 @@ func toList(listof []*model.RepoLite) (string, []interface{}) {
var qs = make([]string, size, size) var qs = make([]string, size, size)
var in = make([]interface{}, size, size) var in = make([]interface{}, size, size)
for i, repo := range listof { for i, repo := range listof {
qs[i] = "$" + strconv.Itoa(i+1) qs[i] = "?"
in[i] = repo.FullName in[i] = repo.FullName
} }
return strings.Join(qs, ","), in return strings.Join(qs, ","), in