fix unit test
This commit is contained in:
parent
7c3988ecc3
commit
0ad78aed65
1 changed files with 10 additions and 6 deletions
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue