MM-21976: Include cache layer to be tested (#13749)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c9a0418a32
Коммит
b162cf92cd
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/mattermost/mattermost-server/v5/config"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/store/localcachelayer"
|
||||
"github.com/mattermost/mattermost-server/v5/utils"
|
||||
)
|
||||
|
||||
@@ -45,6 +46,8 @@ func setupTestHelper(enterprise bool) *TestHelper {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
// Adds the cache layer to the test store
|
||||
s.Store = localcachelayer.NewLocalCacheLayer(s.Store, s.Metrics, s.Cluster, s.CacheProvider)
|
||||
|
||||
th := &TestHelper{
|
||||
App: s.FakeApp(),
|
||||
@@ -244,6 +247,8 @@ func (me *TestHelper) AddUserToChannel(user *model.User, channel *model.Channel)
|
||||
}
|
||||
|
||||
func (me *TestHelper) TearDown() {
|
||||
// Clean all the caches
|
||||
me.App.InvalidateAllCaches()
|
||||
me.Server.Shutdown()
|
||||
if err := recover(); err != nil {
|
||||
panic(err)
|
||||
|
||||
Ссылка в новой задаче
Block a user