mirror of
https://github.com/mattermost/focalboard.git
synced 2024-12-24 13:43:12 +02:00
fix unit test
This commit is contained in:
parent
7c3988ecc3
commit
0ad78aed65
@ -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 New Issue
Block a user