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 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
}