mirror of https://github.com/coder/coder.git
fix: ci uses a migrated DB template (#2696)
Signed-off-by: Spike Curtis <spike@coder.com>
This commit is contained in:
parent
576aef40f2
commit
cb2d1f488a
2
Makefile
2
Makefile
|
@ -172,7 +172,7 @@ test: test-clean
|
|||
.PHONY: test
|
||||
|
||||
test-postgres: test-clean test-postgres-docker
|
||||
DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum --junitfile="gotests.xml" --packages="./..." -- \
|
||||
DB=ci DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum --junitfile="gotests.xml" --packages="./..." -- \
|
||||
-covermode=atomic -coverprofile="gotests.coverage" -timeout=30m \
|
||||
-coverpkg=./...,github.com/coder/coder/codersdk \
|
||||
-count=2 -race -failfast
|
||||
|
|
|
@ -27,7 +27,14 @@ func main() {
|
|||
panic(err)
|
||||
}
|
||||
|
||||
err = database.MigrateUp(db)
|
||||
targetURL := fmt.Sprintf("postgres://postgres:postgres@127.0.0.1:5432/%s?sslmode=disable", dbName)
|
||||
target, err := sql.Open("postgres", targetURL)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer target.Close()
|
||||
|
||||
err = database.MigrateUp(target)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue