Mockery started to throw errors like "Unexpected package creation during export data loading".

This was consistently reproducible locally and on upgrade, it has gone away.

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2023-04-10 14:20:57 +05:30
коммит произвёл GitHub
родитель 6be0ed0d19
Коммит bcf115e315
77 изменённых файлов: 4317 добавлений и 876 удалений

Просмотреть файл

@@ -1,4 +1,4 @@
// Code generated by mockery v2.10.4. DO NOT EDIT.
// Code generated by mockery v2.23.2. DO NOT EDIT.
// Regenerate this file using `make searchengine-mocks`.
@@ -405,6 +405,10 @@ func (_m *SearchEngineInterface) SearchChannels(teamId string, userID string, te
ret := _m.Called(teamId, userID, term, isGuest)
var r0 []string
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(string, string, string, bool) ([]string, *model.AppError)); ok {
return rf(teamId, userID, term, isGuest)
}
if rf, ok := ret.Get(0).(func(string, string, string, bool) []string); ok {
r0 = rf(teamId, userID, term, isGuest)
} else {
@@ -413,7 +417,6 @@ func (_m *SearchEngineInterface) SearchChannels(teamId string, userID string, te
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(string, string, string, bool) *model.AppError); ok {
r1 = rf(teamId, userID, term, isGuest)
} else {
@@ -430,6 +433,10 @@ func (_m *SearchEngineInterface) SearchFiles(channels model.ChannelList, searchP
ret := _m.Called(channels, searchParams, page, perPage)
var r0 []string
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(model.ChannelList, []*model.SearchParams, int, int) ([]string, *model.AppError)); ok {
return rf(channels, searchParams, page, perPage)
}
if rf, ok := ret.Get(0).(func(model.ChannelList, []*model.SearchParams, int, int) []string); ok {
r0 = rf(channels, searchParams, page, perPage)
} else {
@@ -438,7 +445,6 @@ func (_m *SearchEngineInterface) SearchFiles(channels model.ChannelList, searchP
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(model.ChannelList, []*model.SearchParams, int, int) *model.AppError); ok {
r1 = rf(channels, searchParams, page, perPage)
} else {
@@ -455,6 +461,11 @@ func (_m *SearchEngineInterface) SearchPosts(channels model.ChannelList, searchP
ret := _m.Called(channels, searchParams, page, perPage)
var r0 []string
var r1 model.PostSearchMatches
var r2 *model.AppError
if rf, ok := ret.Get(0).(func(model.ChannelList, []*model.SearchParams, int, int) ([]string, model.PostSearchMatches, *model.AppError)); ok {
return rf(channels, searchParams, page, perPage)
}
if rf, ok := ret.Get(0).(func(model.ChannelList, []*model.SearchParams, int, int) []string); ok {
r0 = rf(channels, searchParams, page, perPage)
} else {
@@ -463,7 +474,6 @@ func (_m *SearchEngineInterface) SearchPosts(channels model.ChannelList, searchP
}
}
var r1 model.PostSearchMatches
if rf, ok := ret.Get(1).(func(model.ChannelList, []*model.SearchParams, int, int) model.PostSearchMatches); ok {
r1 = rf(channels, searchParams, page, perPage)
} else {
@@ -472,7 +482,6 @@ func (_m *SearchEngineInterface) SearchPosts(channels model.ChannelList, searchP
}
}
var r2 *model.AppError
if rf, ok := ret.Get(2).(func(model.ChannelList, []*model.SearchParams, int, int) *model.AppError); ok {
r2 = rf(channels, searchParams, page, perPage)
} else {
@@ -489,6 +498,11 @@ func (_m *SearchEngineInterface) SearchUsersInChannel(teamId string, channelId s
ret := _m.Called(teamId, channelId, restrictedToChannels, term, options)
var r0 []string
var r1 []string
var r2 *model.AppError
if rf, ok := ret.Get(0).(func(string, string, []string, string, *model.UserSearchOptions) ([]string, []string, *model.AppError)); ok {
return rf(teamId, channelId, restrictedToChannels, term, options)
}
if rf, ok := ret.Get(0).(func(string, string, []string, string, *model.UserSearchOptions) []string); ok {
r0 = rf(teamId, channelId, restrictedToChannels, term, options)
} else {
@@ -497,7 +511,6 @@ func (_m *SearchEngineInterface) SearchUsersInChannel(teamId string, channelId s
}
}
var r1 []string
if rf, ok := ret.Get(1).(func(string, string, []string, string, *model.UserSearchOptions) []string); ok {
r1 = rf(teamId, channelId, restrictedToChannels, term, options)
} else {
@@ -506,7 +519,6 @@ func (_m *SearchEngineInterface) SearchUsersInChannel(teamId string, channelId s
}
}
var r2 *model.AppError
if rf, ok := ret.Get(2).(func(string, string, []string, string, *model.UserSearchOptions) *model.AppError); ok {
r2 = rf(teamId, channelId, restrictedToChannels, term, options)
} else {
@@ -523,6 +535,10 @@ func (_m *SearchEngineInterface) SearchUsersInTeam(teamId string, restrictedToCh
ret := _m.Called(teamId, restrictedToChannels, term, options)
var r0 []string
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(string, []string, string, *model.UserSearchOptions) ([]string, *model.AppError)); ok {
return rf(teamId, restrictedToChannels, term, options)
}
if rf, ok := ret.Get(0).(func(string, []string, string, *model.UserSearchOptions) []string); ok {
r0 = rf(teamId, restrictedToChannels, term, options)
} else {
@@ -531,7 +547,6 @@ func (_m *SearchEngineInterface) SearchUsersInTeam(teamId string, restrictedToCh
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(string, []string, string, *model.UserSearchOptions) *model.AppError); ok {
r1 = rf(teamId, restrictedToChannels, term, options)
} else {
@@ -595,3 +610,18 @@ func (_m *SearchEngineInterface) TestConfig(cfg *model.Config) *model.AppError {
func (_m *SearchEngineInterface) UpdateConfig(cfg *model.Config) {
_m.Called(cfg)
}
type mockConstructorTestingTNewSearchEngineInterface interface {
mock.TestingT
Cleanup(func())
}
// NewSearchEngineInterface creates a new instance of SearchEngineInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewSearchEngineInterface(t mockConstructorTestingTNewSearchEngineInterface) *SearchEngineInterface {
mock := &SearchEngineInterface{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

Просмотреть файл

@@ -1,4 +1,4 @@
// Code generated by mockery v2.10.4. DO NOT EDIT.
// Code generated by mockery v2.23.2. DO NOT EDIT.
// Regenerate this file using `make sharedchannel-mocks`.
@@ -23,6 +23,10 @@ func (_m *MockAppIface) AddUserToChannel(c request.CTX, user *model.User, channe
ret := _m.Called(c, user, channel, skipTeamMemberIntegrityCheck)
var r0 *model.ChannelMember
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, *model.User, *model.Channel, bool) (*model.ChannelMember, *model.AppError)); ok {
return rf(c, user, channel, skipTeamMemberIntegrityCheck)
}
if rf, ok := ret.Get(0).(func(request.CTX, *model.User, *model.Channel, bool) *model.ChannelMember); ok {
r0 = rf(c, user, channel, skipTeamMemberIntegrityCheck)
} else {
@@ -31,7 +35,6 @@ func (_m *MockAppIface) AddUserToChannel(c request.CTX, user *model.User, channe
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(request.CTX, *model.User, *model.Channel, bool) *model.AppError); ok {
r1 = rf(c, user, channel, skipTeamMemberIntegrityCheck)
} else {
@@ -64,6 +67,10 @@ func (_m *MockAppIface) CreateChannelWithUser(c request.CTX, channel *model.Chan
ret := _m.Called(c, channel, userId)
var r0 *model.Channel
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel, string) (*model.Channel, *model.AppError)); ok {
return rf(c, channel, userId)
}
if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel, string) *model.Channel); ok {
r0 = rf(c, channel, userId)
} else {
@@ -72,7 +79,6 @@ func (_m *MockAppIface) CreateChannelWithUser(c request.CTX, channel *model.Chan
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(request.CTX, *model.Channel, string) *model.AppError); ok {
r1 = rf(c, channel, userId)
} else {
@@ -89,6 +95,10 @@ func (_m *MockAppIface) CreatePost(c request.CTX, post *model.Post, channel *mod
ret := _m.Called(c, post, channel, triggerWebhooks, setOnline)
var r0 *model.Post
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, *model.Channel, bool, bool) (*model.Post, *model.AppError)); ok {
return rf(c, post, channel, triggerWebhooks, setOnline)
}
if rf, ok := ret.Get(0).(func(request.CTX, *model.Post, *model.Channel, bool, bool) *model.Post); ok {
r0 = rf(c, post, channel, triggerWebhooks, setOnline)
} else {
@@ -97,7 +107,6 @@ func (_m *MockAppIface) CreatePost(c request.CTX, post *model.Post, channel *mod
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(request.CTX, *model.Post, *model.Channel, bool, bool) *model.AppError); ok {
r1 = rf(c, post, channel, triggerWebhooks, setOnline)
} else {
@@ -114,6 +123,10 @@ func (_m *MockAppIface) CreateUploadSession(c request.CTX, us *model.UploadSessi
ret := _m.Called(c, us)
var r0 *model.UploadSession
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, *model.UploadSession) (*model.UploadSession, *model.AppError)); ok {
return rf(c, us)
}
if rf, ok := ret.Get(0).(func(request.CTX, *model.UploadSession) *model.UploadSession); ok {
r0 = rf(c, us)
} else {
@@ -122,7 +135,6 @@ func (_m *MockAppIface) CreateUploadSession(c request.CTX, us *model.UploadSessi
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(request.CTX, *model.UploadSession) *model.AppError); ok {
r1 = rf(c, us)
} else {
@@ -139,6 +151,10 @@ func (_m *MockAppIface) DeletePost(c request.CTX, postID string, deleteByID stri
ret := _m.Called(c, postID, deleteByID)
var r0 *model.Post
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, string, string) (*model.Post, *model.AppError)); ok {
return rf(c, postID, deleteByID)
}
if rf, ok := ret.Get(0).(func(request.CTX, string, string) *model.Post); ok {
r0 = rf(c, postID, deleteByID)
} else {
@@ -147,7 +163,6 @@ func (_m *MockAppIface) DeletePost(c request.CTX, postID string, deleteByID stri
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(request.CTX, string, string) *model.AppError); ok {
r1 = rf(c, postID, deleteByID)
} else {
@@ -180,6 +195,10 @@ func (_m *MockAppIface) FileReader(path string) (filestore.ReadCloseSeeker, *mod
ret := _m.Called(path)
var r0 filestore.ReadCloseSeeker
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(string) (filestore.ReadCloseSeeker, *model.AppError)); ok {
return rf(path)
}
if rf, ok := ret.Get(0).(func(string) filestore.ReadCloseSeeker); ok {
r0 = rf(path)
} else {
@@ -188,7 +207,6 @@ func (_m *MockAppIface) FileReader(path string) (filestore.ReadCloseSeeker, *mod
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
r1 = rf(path)
} else {
@@ -212,6 +230,10 @@ func (_m *MockAppIface) GetOrCreateDirectChannel(c request.CTX, userId string, o
ret := _m.Called(_ca...)
var r0 *model.Channel
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, string, string, ...model.ChannelOption) (*model.Channel, *model.AppError)); ok {
return rf(c, userId, otherUserId, channelOptions...)
}
if rf, ok := ret.Get(0).(func(request.CTX, string, string, ...model.ChannelOption) *model.Channel); ok {
r0 = rf(c, userId, otherUserId, channelOptions...)
} else {
@@ -220,7 +242,6 @@ func (_m *MockAppIface) GetOrCreateDirectChannel(c request.CTX, userId string, o
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(request.CTX, string, string, ...model.ChannelOption) *model.AppError); ok {
r1 = rf(c, userId, otherUserId, channelOptions...)
} else {
@@ -237,6 +258,11 @@ func (_m *MockAppIface) GetProfileImage(user *model.User) ([]byte, bool, *model.
ret := _m.Called(user)
var r0 []byte
var r1 bool
var r2 *model.AppError
if rf, ok := ret.Get(0).(func(*model.User) ([]byte, bool, *model.AppError)); ok {
return rf(user)
}
if rf, ok := ret.Get(0).(func(*model.User) []byte); ok {
r0 = rf(user)
} else {
@@ -245,14 +271,12 @@ func (_m *MockAppIface) GetProfileImage(user *model.User) ([]byte, bool, *model.
}
}
var r1 bool
if rf, ok := ret.Get(1).(func(*model.User) bool); ok {
r1 = rf(user)
} else {
r1 = ret.Get(1).(bool)
}
var r2 *model.AppError
if rf, ok := ret.Get(2).(func(*model.User) *model.AppError); ok {
r2 = rf(user)
} else {
@@ -295,6 +319,10 @@ func (_m *MockAppIface) PatchChannelModerationsForChannel(c request.CTX, channel
ret := _m.Called(c, channel, channelModerationsPatch)
var r0 []*model.ChannelModeration
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel, []*model.ChannelModerationPatch) ([]*model.ChannelModeration, *model.AppError)); ok {
return rf(c, channel, channelModerationsPatch)
}
if rf, ok := ret.Get(0).(func(request.CTX, *model.Channel, []*model.ChannelModerationPatch) []*model.ChannelModeration); ok {
r0 = rf(c, channel, channelModerationsPatch)
} else {
@@ -303,7 +331,6 @@ func (_m *MockAppIface) PatchChannelModerationsForChannel(c request.CTX, channel
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(request.CTX, *model.Channel, []*model.ChannelModerationPatch) *model.AppError); ok {
r1 = rf(c, channel, channelModerationsPatch)
} else {
@@ -336,6 +363,10 @@ func (_m *MockAppIface) SaveReactionForPost(c *request.Context, reaction *model.
ret := _m.Called(c, reaction)
var r0 *model.Reaction
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(*request.Context, *model.Reaction) (*model.Reaction, *model.AppError)); ok {
return rf(c, reaction)
}
if rf, ok := ret.Get(0).(func(*request.Context, *model.Reaction) *model.Reaction); ok {
r0 = rf(c, reaction)
} else {
@@ -344,7 +375,6 @@ func (_m *MockAppIface) SaveReactionForPost(c *request.Context, reaction *model.
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(*request.Context, *model.Reaction) *model.AppError); ok {
r1 = rf(c, reaction)
} else {
@@ -377,6 +407,10 @@ func (_m *MockAppIface) UpdatePost(c *request.Context, post *model.Post, safeUpd
ret := _m.Called(c, post, safeUpdate)
var r0 *model.Post
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(*request.Context, *model.Post, bool) (*model.Post, *model.AppError)); ok {
return rf(c, post, safeUpdate)
}
if rf, ok := ret.Get(0).(func(*request.Context, *model.Post, bool) *model.Post); ok {
r0 = rf(c, post, safeUpdate)
} else {
@@ -385,7 +419,6 @@ func (_m *MockAppIface) UpdatePost(c *request.Context, post *model.Post, safeUpd
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(*request.Context, *model.Post, bool) *model.AppError); ok {
r1 = rf(c, post, safeUpdate)
} else {
@@ -396,3 +429,18 @@ func (_m *MockAppIface) UpdatePost(c *request.Context, post *model.Post, safeUpd
return r0, r1
}
type mockConstructorTestingTNewMockAppIface interface {
mock.TestingT
Cleanup(func())
}
// NewMockAppIface creates a new instance of MockAppIface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewMockAppIface(t mockConstructorTestingTNewMockAppIface) *MockAppIface {
mock := &MockAppIface{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

Просмотреть файл

@@ -1,4 +1,4 @@
// Code generated by mockery v2.10.4. DO NOT EDIT.
// Code generated by mockery v2.23.2. DO NOT EDIT.
// Regenerate this file using `make sharedchannel-mocks`.
@@ -116,3 +116,18 @@ func (_m *MockServerIface) Log() *mlog.Logger {
func (_m *MockServerIface) RemoveClusterLeaderChangedListener(id string) {
_m.Called(id)
}
type mockConstructorTestingTNewMockServerIface interface {
mock.TestingT
Cleanup(func())
}
// NewMockServerIface creates a new instance of MockServerIface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewMockServerIface(t mockConstructorTestingTNewMockServerIface) *MockServerIface {
mock := &MockServerIface{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}

Просмотреть файл

@@ -1,4 +1,4 @@
// Code generated by mockery v2.10.4. DO NOT EDIT.
// Code generated by mockery v2.23.2. DO NOT EDIT.
// Regenerate this file using `make telemetry-mocks`.
@@ -59,6 +59,10 @@ func (_m *ServerIface) GetRoleByName(_a0 context.Context, _a1 string) (*model.Ro
ret := _m.Called(_a0, _a1)
var r0 *model.Role
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(context.Context, string) (*model.Role, *model.AppError)); ok {
return rf(_a0, _a1)
}
if rf, ok := ret.Get(0).(func(context.Context, string) *model.Role); ok {
r0 = rf(_a0, _a1)
} else {
@@ -67,7 +71,6 @@ func (_m *ServerIface) GetRoleByName(_a0 context.Context, _a1 string) (*model.Ro
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(context.Context, string) *model.AppError); ok {
r1 = rf(_a0, _a1)
} else {
@@ -84,6 +87,10 @@ func (_m *ServerIface) GetSchemes(_a0 string, _a1 int, _a2 int) ([]*model.Scheme
ret := _m.Called(_a0, _a1, _a2)
var r0 []*model.Scheme
var r1 *model.AppError
if rf, ok := ret.Get(0).(func(string, int, int) ([]*model.Scheme, *model.AppError)); ok {
return rf(_a0, _a1, _a2)
}
if rf, ok := ret.Get(0).(func(string, int, int) []*model.Scheme); ok {
r0 = rf(_a0, _a1, _a2)
} else {
@@ -92,7 +99,6 @@ func (_m *ServerIface) GetSchemes(_a0 string, _a1 int, _a2 int) ([]*model.Scheme
}
}
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
r1 = rf(_a0, _a1, _a2)
} else {
@@ -165,3 +171,18 @@ func (_m *ServerIface) License() *model.License {
return r0
}
type mockConstructorTestingTNewServerIface interface {
mock.TestingT
Cleanup(func())
}
// NewServerIface creates a new instance of ServerIface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewServerIface(t mockConstructorTestingTNewServerIface) *ServerIface {
mock := &ServerIface{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}