Switch to Postgres when running tests and turn off the fsync setting (#13678)
* Run all tests fasts in postgres * Moving postgres config to a file * Addressing PR review comments * Testing against mysql in the CI to keep things less changed * Revert "Testing against mysql in the CI to keep things less changed" This reverts commit fc940c111db269a821c54e005d76df87cb70e031. * Fixing a test broken in postgres but working in mysql * Fixing some tests * Fixing some config tests with postgres * Fixing the rest of config tests * Fixing govet error * Fixing search tests for postgres
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
55b646ecf8
Коммит
596f986755
@@ -5,7 +5,6 @@ package commands
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"reflect"
|
||||
@@ -81,6 +80,13 @@ type TestPluginSettings struct {
|
||||
SignaturePublicKeyFiles []string
|
||||
}
|
||||
|
||||
func getDsn(driver string, source string) string {
|
||||
if driver == model.DATABASE_DRIVER_MYSQL {
|
||||
return driver + "://" + source
|
||||
}
|
||||
return source
|
||||
}
|
||||
|
||||
func TestConfigValidate(t *testing.T) {
|
||||
th := Setup()
|
||||
defer th.TearDown()
|
||||
@@ -533,7 +539,7 @@ func TestConfigMigrate(t *testing.T) {
|
||||
defer th.TearDown()
|
||||
|
||||
sqlSettings := mainHelper.GetSQLSettings()
|
||||
sqlDSN := fmt.Sprintf("%s://%s", *sqlSettings.DriverName, *sqlSettings.DataSource)
|
||||
sqlDSN := getDsn(*sqlSettings.DriverName, *sqlSettings.DataSource)
|
||||
fileDSN := "config.json"
|
||||
|
||||
ds, err := config.NewStore(sqlDSN, false)
|
||||
|
||||
Ссылка в новой задаче
Block a user