Enable products for tests (#22757)
* Enable products for channels tests * increase unit test timeout; check IsConfigReadOnly * make app-layers * Avoid loading boards tempaltes between tests to improve speed * Fix delete query to be compatible with both databases * Avoid preserving the templates for boards store tests * Run all tests in one command * Revert "Run all tests in one command" This reverts commit 0330f7cd8f96b47776770e8f80ba6ba18d98b8d1. * concurrent pkg group tests in CI * Revert "Revert "Run all tests in one command"" This reverts commit 73892fec772575ff054a99ba9e00a7b57ca74164. * Revert "concurrent pkg group tests in CI" This reverts commit 550fb6cdd4a7f14d9632f2626bc66f389173b5d9. * try testing 3 subsets of packages concurrently to improve time taken * Revert "try testing 3 subsets of packages concurrently to improve time taken" This reverts commit 97475f3c4eafa8bbe047097e0841220884f68cdc. --------- Co-authored-by: Mattermost Build <build@mattermost.com> Co-authored-by: wiggin77 <wiggin77@warpmail.net>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
a8d79ec3da
Коммит
067e36c23c
@@ -65,6 +65,11 @@ func (ps *PlatformService) UpdateConfig(f func(*model.Config)) {
|
||||
}
|
||||
}
|
||||
|
||||
// IsConfigReadOnly returns true if the underlying configstore is readonly.
|
||||
func (ps *PlatformService) IsConfigReadOnly() bool {
|
||||
return ps.configStore.IsReadOnly()
|
||||
}
|
||||
|
||||
// SaveConfig replaces the active configuration, optionally notifying cluster peers.
|
||||
// It returns both the previous and current configs.
|
||||
func (ps *PlatformService) SaveConfig(newCfg *model.Config, sendConfigChangeClusterMessage bool) (*model.Config, *model.Config, *model.AppError) {
|
||||
|
||||
@@ -99,6 +99,7 @@ func (th *TestHelper) InitBasic() *TestHelper {
|
||||
|
||||
func SetupWithStoreMock(tb testing.TB, options ...Option) *TestHelper {
|
||||
mockStore := testlib.GetMockStoreForSetupFunctions()
|
||||
options = append(options, StoreOverride(mockStore))
|
||||
th := setupTestHelper(mockStore, false, false, tb, options...)
|
||||
statusMock := mocks.StatusStore{}
|
||||
statusMock.On("UpdateExpiredDNDStatuses").Return([]*model.Status{}, nil)
|
||||
@@ -136,6 +137,7 @@ func setupTestHelper(dbStore store.Store, enterprise bool, includeCacheLayer boo
|
||||
configStore := config.NewTestMemoryStore()
|
||||
|
||||
memoryConfig := configStore.Get()
|
||||
memoryConfig.SqlSettings = *mainHelper.GetSQLSettings()
|
||||
*memoryConfig.PluginSettings.Directory = filepath.Join(tempWorkspace, "plugins")
|
||||
*memoryConfig.PluginSettings.ClientDirectory = filepath.Join(tempWorkspace, "webapp")
|
||||
*memoryConfig.PluginSettings.AutomaticPrepackagedPlugins = false
|
||||
|
||||
@@ -28,16 +28,7 @@ func TestReadReplicaDisabledBasedOnLicense(t *testing.T) {
|
||||
if driverName == "" {
|
||||
driverName = model.DatabaseDriverPostgres
|
||||
}
|
||||
dsn := ""
|
||||
if driverName == model.DatabaseDriverPostgres {
|
||||
dsn = os.Getenv("TEST_DATABASE_POSTGRESQL_DSN")
|
||||
} else {
|
||||
dsn = os.Getenv("TEST_DATABASE_MYSQL_DSN")
|
||||
}
|
||||
cfg.SqlSettings = *storetest.MakeSqlSettings(driverName, false)
|
||||
if dsn != "" {
|
||||
cfg.SqlSettings.DataSource = &dsn
|
||||
}
|
||||
cfg.SqlSettings.DataSourceReplicas = []string{*cfg.SqlSettings.DataSource}
|
||||
cfg.SqlSettings.DataSourceSearchReplicas = []string{*cfg.SqlSettings.DataSource}
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@ func TestHubStopWithMultipleConnections(t *testing.T) {
|
||||
// block the caller indefinitely.
|
||||
func TestHubStopRaceCondition(t *testing.T) {
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.Service.Store.Close()
|
||||
// We do not call TearDown because th.TearDown shuts down the hub again. And hub close is not idempotent.
|
||||
// Making it idempotent is not really important to the server because close only happens once.
|
||||
// So we just use this quick hack for the test.
|
||||
|
||||
Ссылка в новой задаче
Block a user