mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
disable playbooks for more tests
This commit is contained in:
@@ -110,6 +110,11 @@ func setupTestHelper(dbStore store.Store, searchEngine *searchengine.Broker, ent
|
||||
os.Unsetenv("MM_FEATUREFLAGS_BoardsProduct")
|
||||
memoryConfig.FeatureFlags.BoardsProduct = false
|
||||
|
||||
// disable Playbooks (temporarily) as it causes many more mocked methods to get
|
||||
// called, and cannot receieve a mocked database.
|
||||
playbooksDisableEnvValue := os.Getenv("MM_DISABLE_PLAYBOOKS")
|
||||
os.Setenv("MM_DISABLE_PLAYBOOKS", "true")
|
||||
|
||||
if updateConfig != nil {
|
||||
updateConfig(memoryConfig)
|
||||
}
|
||||
@@ -148,14 +153,15 @@ func setupTestHelper(dbStore store.Store, searchEngine *searchengine.Broker, ent
|
||||
}
|
||||
|
||||
th := &TestHelper{
|
||||
App: app.New(app.ServerConnector(s.Channels())),
|
||||
Server: s,
|
||||
ConfigStore: configStore,
|
||||
IncludeCacheLayer: includeCache,
|
||||
Context: request.EmptyContext(testLogger),
|
||||
TestLogger: testLogger,
|
||||
LogBuffer: buffer,
|
||||
boardsProductEnvValue: boardsProductEnvValue,
|
||||
App: app.New(app.ServerConnector(s.Channels())),
|
||||
Server: s,
|
||||
ConfigStore: configStore,
|
||||
IncludeCacheLayer: includeCache,
|
||||
Context: request.EmptyContext(testLogger),
|
||||
TestLogger: testLogger,
|
||||
LogBuffer: buffer,
|
||||
boardsProductEnvValue: boardsProductEnvValue,
|
||||
playbooksDisableEnvValue: playbooksDisableEnvValue,
|
||||
}
|
||||
th.Context.SetLogger(testLogger)
|
||||
|
||||
@@ -317,11 +323,6 @@ func SetupConfigWithStoreMock(tb testing.TB, updateConfig func(cfg *model.Config
|
||||
}
|
||||
|
||||
func SetupWithStoreMock(tb testing.TB) *TestHelper {
|
||||
// disable Playbooks (temporarily) as it causes many more mocked methods to get
|
||||
// called, and cannot receieve a mocked database. Boards is already disabled here.
|
||||
playbooksDisableEnvValue := os.Getenv("MM_DISABLE_PLAYBOOKS")
|
||||
os.Setenv("MM_DISABLE_PLAYBOOKS", "true")
|
||||
|
||||
th := setupTestHelper(testlib.GetMockStoreForSetupFunctions(), nil, false, false, nil, nil)
|
||||
statusMock := mocks.StatusStore{}
|
||||
statusMock.On("UpdateExpiredDNDStatuses").Return([]*model.Status{}, nil)
|
||||
@@ -332,8 +333,6 @@ func SetupWithStoreMock(tb testing.TB) *TestHelper {
|
||||
emptyMockStore.On("Close").Return(nil)
|
||||
emptyMockStore.On("Status").Return(&statusMock)
|
||||
th.App.Srv().SetStore(&emptyMockStore)
|
||||
|
||||
th.playbooksDisableEnvValue = playbooksDisableEnvValue
|
||||
return th
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user