fix unit test

This commit is contained in:
Scott Bishel 2022-02-17 17:36:06 -07:00
parent 7c3988ecc3
commit 0ad78aed65

View file

@ -35,7 +35,7 @@ type TestHelper struct {
}
func getTestConfig() (*config.Configuration, error) {
dbType, _, err := sqlstore.PrepareNewTestDatabase()
dbType, connectionString, err := sqlstore.PrepareNewTestDatabase()
if err != nil {
return nil, err
}
@ -62,17 +62,21 @@ func getTestConfig() (*config.Configuration, error) {
}
}`
dbFile, err := ioutil.TempFile("", "focalboard-test-*.db")
if err != nil {
panic(err)
if dbType == "sqlite3" {
dbFile, err := ioutil.TempFile("", "focalboard-test-*.db")
if err != nil {
panic(err)
}
dbFile.Close()
connectionString = dbFile.Name()
}
dbFile.Close()
return &config.Configuration{
ServerRoot: "http://localhost:8888",
Port: 8888,
DBType: dbType,
DBConfigString: dbFile.Name(),
DBConfigString: connectionString,
DBTablePrefix: "test_",
WebPath: "./pack",
FilesDriver: "local",