mirror of
https://github.com/thomiceli/opengist.git
synced 2025-06-14 06:07:14 +02:00
Fix test database with go command (#442)
This commit is contained in:
@ -161,14 +161,12 @@ func Setup(t *testing.T) *TestServer {
|
|||||||
var databaseDsn string
|
var databaseDsn string
|
||||||
databaseType = os.Getenv("OPENGIST_TEST_DB")
|
databaseType = os.Getenv("OPENGIST_TEST_DB")
|
||||||
switch databaseType {
|
switch databaseType {
|
||||||
case "sqlite":
|
|
||||||
databaseDsn = "file:" + filepath.Join(homePath, "tmp", "opengist_test.db")
|
|
||||||
case "postgres":
|
case "postgres":
|
||||||
databaseDsn = "postgres://postgres:opengist@localhost:5432/opengist_test"
|
databaseDsn = "postgres://postgres:opengist@localhost:5432/opengist_test"
|
||||||
case "mysql":
|
case "mysql":
|
||||||
databaseDsn = "mysql://root:opengist@localhost:3306/opengist_test"
|
databaseDsn = "mysql://root:opengist@localhost:3306/opengist_test"
|
||||||
default:
|
default:
|
||||||
databaseDsn = ":memory:"
|
databaseDsn = "file:" + filepath.Join(homePath, "tmp", "opengist_test.db")
|
||||||
}
|
}
|
||||||
|
|
||||||
err = os.MkdirAll(filepath.Join(homePath, "tests"), 0755)
|
err = os.MkdirAll(filepath.Join(homePath, "tests"), 0755)
|
||||||
|
Reference in New Issue
Block a user