MM-27041: Do not run tests against both DBs in CI (#15060)
* MM-27041: Do not run tests against both DBs in CI We already run the entire test suite for both mysql and postgres in parallel in CI. So we just run the tests for the current database set. * Fix incorrect env var
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
fe15ec4ae5
Коммит
bf03f391e6
@@ -4,6 +4,7 @@
|
||||
package sqlstore
|
||||
|
||||
import (
|
||||
"os"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
@@ -80,14 +81,31 @@ func initStores() {
|
||||
if testing.Short() {
|
||||
return
|
||||
}
|
||||
storeTypes = append(storeTypes, &storeType{
|
||||
Name: "MySQL",
|
||||
SqlSettings: storetest.MakeSqlSettings(model.DATABASE_DRIVER_MYSQL),
|
||||
})
|
||||
storeTypes = append(storeTypes, &storeType{
|
||||
Name: "PostgreSQL",
|
||||
SqlSettings: storetest.MakeSqlSettings(model.DATABASE_DRIVER_POSTGRES),
|
||||
})
|
||||
// In CI, we already run the entire test suite for both mysql and postgres in parallel.
|
||||
// So we just run the tests for the current database set.
|
||||
if os.Getenv("IS_CI") == "true" {
|
||||
switch os.Getenv("MM_SQLSETTINGS_DRIVERNAME") {
|
||||
case "mysql":
|
||||
storeTypes = append(storeTypes, &storeType{
|
||||
Name: "MySQL",
|
||||
SqlSettings: storetest.MakeSqlSettings(model.DATABASE_DRIVER_MYSQL),
|
||||
})
|
||||
case "postgres":
|
||||
storeTypes = append(storeTypes, &storeType{
|
||||
Name: "PostgreSQL",
|
||||
SqlSettings: storetest.MakeSqlSettings(model.DATABASE_DRIVER_POSTGRES),
|
||||
})
|
||||
}
|
||||
} else {
|
||||
storeTypes = append(storeTypes, &storeType{
|
||||
Name: "MySQL",
|
||||
SqlSettings: storetest.MakeSqlSettings(model.DATABASE_DRIVER_MYSQL),
|
||||
})
|
||||
storeTypes = append(storeTypes, &storeType{
|
||||
Name: "PostgreSQL",
|
||||
SqlSettings: storetest.MakeSqlSettings(model.DATABASE_DRIVER_POSTGRES),
|
||||
})
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user