Upgrade mockery to fix errors (#22892)
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 ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6be0ed0d19
Коммит
bcf115e315
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
@@ -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 plugin-mocks`.
|
||||
|
||||
@@ -22,13 +22,16 @@ func (_m *Driver) Conn(isMaster bool) (string, error) {
|
||||
ret := _m.Called(isMaster)
|
||||
|
||||
var r0 string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(bool) (string, error)); ok {
|
||||
return rf(isMaster)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(bool) string); ok {
|
||||
r0 = rf(isMaster)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(bool) error); ok {
|
||||
r1 = rf(isMaster)
|
||||
} else {
|
||||
@@ -57,13 +60,16 @@ func (_m *Driver) ConnExec(connID string, q string, args []driver.NamedValue) (p
|
||||
ret := _m.Called(connID, q, args)
|
||||
|
||||
var r0 plugin.ResultContainer
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, []driver.NamedValue) (plugin.ResultContainer, error)); ok {
|
||||
return rf(connID, q, args)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, []driver.NamedValue) plugin.ResultContainer); ok {
|
||||
r0 = rf(connID, q, args)
|
||||
} else {
|
||||
r0 = ret.Get(0).(plugin.ResultContainer)
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string, []driver.NamedValue) error); ok {
|
||||
r1 = rf(connID, q, args)
|
||||
} else {
|
||||
@@ -92,13 +98,16 @@ func (_m *Driver) ConnQuery(connID string, q string, args []driver.NamedValue) (
|
||||
ret := _m.Called(connID, q, args)
|
||||
|
||||
var r0 string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string, []driver.NamedValue) (string, error)); ok {
|
||||
return rf(connID, q, args)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string, []driver.NamedValue) string); ok {
|
||||
r0 = rf(connID, q, args)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string, []driver.NamedValue) error); ok {
|
||||
r1 = rf(connID, q, args)
|
||||
} else {
|
||||
@@ -141,20 +150,23 @@ func (_m *Driver) RowsColumnTypePrecisionScale(rowsID string, index int) (int64,
|
||||
ret := _m.Called(rowsID, index)
|
||||
|
||||
var r0 int64
|
||||
var r1 int64
|
||||
var r2 bool
|
||||
if rf, ok := ret.Get(0).(func(string, int) (int64, int64, bool)); ok {
|
||||
return rf(rowsID, index)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, int) int64); ok {
|
||||
r0 = rf(rowsID, index)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
var r1 int64
|
||||
if rf, ok := ret.Get(1).(func(string, int) int64); ok {
|
||||
r1 = rf(rowsID, index)
|
||||
} else {
|
||||
r1 = ret.Get(1).(int64)
|
||||
}
|
||||
|
||||
var r2 bool
|
||||
if rf, ok := ret.Get(2).(func(string, int) bool); ok {
|
||||
r2 = rf(rowsID, index)
|
||||
} else {
|
||||
@@ -227,13 +239,16 @@ func (_m *Driver) Stmt(connID string, q string) (string, error) {
|
||||
ret := _m.Called(connID, q)
|
||||
|
||||
var r0 string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, string) (string, error)); ok {
|
||||
return rf(connID, q)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, string) string); ok {
|
||||
r0 = rf(connID, q)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(connID, q)
|
||||
} else {
|
||||
@@ -262,13 +277,16 @@ func (_m *Driver) StmtExec(stID string, args []driver.NamedValue) (plugin.Result
|
||||
ret := _m.Called(stID, args)
|
||||
|
||||
var r0 plugin.ResultContainer
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, []driver.NamedValue) (plugin.ResultContainer, error)); ok {
|
||||
return rf(stID, args)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, []driver.NamedValue) plugin.ResultContainer); ok {
|
||||
r0 = rf(stID, args)
|
||||
} else {
|
||||
r0 = ret.Get(0).(plugin.ResultContainer)
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, []driver.NamedValue) error); ok {
|
||||
r1 = rf(stID, args)
|
||||
} else {
|
||||
@@ -297,13 +315,16 @@ func (_m *Driver) StmtQuery(stID string, args []driver.NamedValue) (string, erro
|
||||
ret := _m.Called(stID, args)
|
||||
|
||||
var r0 string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, []driver.NamedValue) (string, error)); ok {
|
||||
return rf(stID, args)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, []driver.NamedValue) string); ok {
|
||||
r0 = rf(stID, args)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, []driver.NamedValue) error); ok {
|
||||
r1 = rf(stID, args)
|
||||
} else {
|
||||
@@ -318,13 +339,16 @@ func (_m *Driver) Tx(connID string, opts driver.TxOptions) (string, error) {
|
||||
ret := _m.Called(connID, opts)
|
||||
|
||||
var r0 string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(string, driver.TxOptions) (string, error)); ok {
|
||||
return rf(connID, opts)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(string, driver.TxOptions) string); ok {
|
||||
r0 = rf(connID, opts)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, driver.TxOptions) error); ok {
|
||||
r1 = rf(connID, opts)
|
||||
} else {
|
||||
@@ -361,3 +385,18 @@ func (_m *Driver) TxRollback(txID string) error {
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
type mockConstructorTestingTNewDriver interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}
|
||||
|
||||
// NewDriver creates a new instance of Driver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
func NewDriver(t mockConstructorTestingTNewDriver) *Driver {
|
||||
mock := &Driver{}
|
||||
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 plugin-mocks`.
|
||||
|
||||
@@ -30,6 +30,10 @@ func (_m *Hooks) ExecuteCommand(c *plugin.Context, args *model.CommandArgs) (*mo
|
||||
ret := _m.Called(c, args)
|
||||
|
||||
var r0 *model.CommandResponse
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.CommandArgs) (*model.CommandResponse, *model.AppError)); ok {
|
||||
return rf(c, args)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.CommandArgs) *model.CommandResponse); ok {
|
||||
r0 = rf(c, args)
|
||||
} else {
|
||||
@@ -38,7 +42,6 @@ func (_m *Hooks) ExecuteCommand(c *plugin.Context, args *model.CommandArgs) (*mo
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(*plugin.Context, *model.CommandArgs) *model.AppError); ok {
|
||||
r1 = rf(c, args)
|
||||
} else {
|
||||
@@ -55,6 +58,10 @@ func (_m *Hooks) FileWillBeUploaded(c *plugin.Context, info *model.FileInfo, fil
|
||||
ret := _m.Called(c, info, file, output)
|
||||
|
||||
var r0 *model.FileInfo
|
||||
var r1 string
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.FileInfo, io.Reader, io.Writer) (*model.FileInfo, string)); ok {
|
||||
return rf(c, info, file, output)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.FileInfo, io.Reader, io.Writer) *model.FileInfo); ok {
|
||||
r0 = rf(c, info, file, output)
|
||||
} else {
|
||||
@@ -63,7 +70,6 @@ func (_m *Hooks) FileWillBeUploaded(c *plugin.Context, info *model.FileInfo, fil
|
||||
}
|
||||
}
|
||||
|
||||
var r1 string
|
||||
if rf, ok := ret.Get(1).(func(*plugin.Context, *model.FileInfo, io.Reader, io.Writer) string); ok {
|
||||
r1 = rf(c, info, file, output)
|
||||
} else {
|
||||
@@ -78,6 +84,10 @@ func (_m *Hooks) GetAllCollectionIDsForUser(c *plugin.Context, userID string, co
|
||||
ret := _m.Called(c, userID, collectionType)
|
||||
|
||||
var r0 []string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, string, string) ([]string, error)); ok {
|
||||
return rf(c, userID, collectionType)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, string, string) []string); ok {
|
||||
r0 = rf(c, userID, collectionType)
|
||||
} else {
|
||||
@@ -86,7 +96,6 @@ func (_m *Hooks) GetAllCollectionIDsForUser(c *plugin.Context, userID string, co
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*plugin.Context, string, string) error); ok {
|
||||
r1 = rf(c, userID, collectionType)
|
||||
} else {
|
||||
@@ -101,6 +110,10 @@ func (_m *Hooks) GetAllUserIdsForCollection(c *plugin.Context, collectionType st
|
||||
ret := _m.Called(c, collectionType, collectionID)
|
||||
|
||||
var r0 []string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, string, string) ([]string, error)); ok {
|
||||
return rf(c, collectionType, collectionID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, string, string) []string); ok {
|
||||
r0 = rf(c, collectionType, collectionID)
|
||||
} else {
|
||||
@@ -109,7 +122,6 @@ func (_m *Hooks) GetAllUserIdsForCollection(c *plugin.Context, collectionType st
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*plugin.Context, string, string) error); ok {
|
||||
r1 = rf(c, collectionType, collectionID)
|
||||
} else {
|
||||
@@ -124,6 +136,10 @@ func (_m *Hooks) GetCollectionMetadataByIds(c *plugin.Context, collectionType st
|
||||
ret := _m.Called(c, collectionType, collectionIds)
|
||||
|
||||
var r0 map[string]*model.CollectionMetadata
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, string, []string) (map[string]*model.CollectionMetadata, error)); ok {
|
||||
return rf(c, collectionType, collectionIds)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, string, []string) map[string]*model.CollectionMetadata); ok {
|
||||
r0 = rf(c, collectionType, collectionIds)
|
||||
} else {
|
||||
@@ -132,7 +148,6 @@ func (_m *Hooks) GetCollectionMetadataByIds(c *plugin.Context, collectionType st
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*plugin.Context, string, []string) error); ok {
|
||||
r1 = rf(c, collectionType, collectionIds)
|
||||
} else {
|
||||
@@ -147,6 +162,10 @@ func (_m *Hooks) GetTopicMetadataByIds(c *plugin.Context, topicType string, topi
|
||||
ret := _m.Called(c, topicType, topicIds)
|
||||
|
||||
var r0 map[string]*model.TopicMetadata
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, string, []string) (map[string]*model.TopicMetadata, error)); ok {
|
||||
return rf(c, topicType, topicIds)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, string, []string) map[string]*model.TopicMetadata); ok {
|
||||
r0 = rf(c, topicType, topicIds)
|
||||
} else {
|
||||
@@ -155,7 +174,6 @@ func (_m *Hooks) GetTopicMetadataByIds(c *plugin.Context, topicType string, topi
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*plugin.Context, string, []string) error); ok {
|
||||
r1 = rf(c, topicType, topicIds)
|
||||
} else {
|
||||
@@ -170,13 +188,16 @@ func (_m *Hooks) GetTopicRedirect(c *plugin.Context, topicType string, topicID s
|
||||
ret := _m.Called(c, topicType, topicID)
|
||||
|
||||
var r0 string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, string, string) (string, error)); ok {
|
||||
return rf(c, topicType, topicID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, string, string) string); ok {
|
||||
r0 = rf(c, topicType, topicID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*plugin.Context, string, string) error); ok {
|
||||
r1 = rf(c, topicType, topicID)
|
||||
} else {
|
||||
@@ -191,6 +212,10 @@ func (_m *Hooks) Implemented() ([]string, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 []string
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func() ([]string, error)); ok {
|
||||
return rf()
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func() []string); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
@@ -199,7 +224,6 @@ func (_m *Hooks) Implemented() ([]string, error) {
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
@@ -224,6 +248,10 @@ func (_m *Hooks) MessageWillBePosted(c *plugin.Context, post *model.Post) (*mode
|
||||
ret := _m.Called(c, post)
|
||||
|
||||
var r0 *model.Post
|
||||
var r1 string
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.Post) (*model.Post, string)); ok {
|
||||
return rf(c, post)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.Post) *model.Post); ok {
|
||||
r0 = rf(c, post)
|
||||
} else {
|
||||
@@ -232,7 +260,6 @@ func (_m *Hooks) MessageWillBePosted(c *plugin.Context, post *model.Post) (*mode
|
||||
}
|
||||
}
|
||||
|
||||
var r1 string
|
||||
if rf, ok := ret.Get(1).(func(*plugin.Context, *model.Post) string); ok {
|
||||
r1 = rf(c, post)
|
||||
} else {
|
||||
@@ -247,6 +274,10 @@ func (_m *Hooks) MessageWillBeUpdated(c *plugin.Context, newPost *model.Post, ol
|
||||
ret := _m.Called(c, newPost, oldPost)
|
||||
|
||||
var r0 *model.Post
|
||||
var r1 string
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.Post, *model.Post) (*model.Post, string)); ok {
|
||||
return rf(c, newPost, oldPost)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.Post, *model.Post) *model.Post); ok {
|
||||
r0 = rf(c, newPost, oldPost)
|
||||
} else {
|
||||
@@ -255,7 +286,6 @@ func (_m *Hooks) MessageWillBeUpdated(c *plugin.Context, newPost *model.Post, ol
|
||||
}
|
||||
}
|
||||
|
||||
var r1 string
|
||||
if rf, ok := ret.Get(1).(func(*plugin.Context, *model.Post, *model.Post) string); ok {
|
||||
r1 = rf(c, newPost, oldPost)
|
||||
} else {
|
||||
@@ -361,13 +391,16 @@ func (_m *Hooks) RunDataRetention(nowTime int64, batchSize int64) (int64, error)
|
||||
ret := _m.Called(nowTime, batchSize)
|
||||
|
||||
var r0 int64
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(int64, int64) (int64, error)); ok {
|
||||
return rf(nowTime, batchSize)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(int64, int64) int64); ok {
|
||||
r0 = rf(nowTime, batchSize)
|
||||
} else {
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(int64, int64) error); ok {
|
||||
r1 = rf(nowTime, batchSize)
|
||||
} else {
|
||||
@@ -417,13 +450,16 @@ func (_m *Hooks) UserHasPermissionToCollection(c *plugin.Context, userID string,
|
||||
ret := _m.Called(c, userID, collectionType, collectionId, permission)
|
||||
|
||||
var r0 bool
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, string, string, string, *model.Permission) (bool, error)); ok {
|
||||
return rf(c, userID, collectionType, collectionId, permission)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(*plugin.Context, string, string, string, *model.Permission) bool); ok {
|
||||
r0 = rf(c, userID, collectionType, collectionId, permission)
|
||||
} else {
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*plugin.Context, string, string, string, *model.Permission) error); ok {
|
||||
r1 = rf(c, userID, collectionType, collectionId, permission)
|
||||
} else {
|
||||
@@ -451,3 +487,18 @@ func (_m *Hooks) UserWillLogIn(c *plugin.Context, user *model.User) string {
|
||||
func (_m *Hooks) WebSocketMessageHasBeenPosted(webConnID string, userID string, req *model.WebSocketRequest) {
|
||||
_m.Called(webConnID, userID, req)
|
||||
}
|
||||
|
||||
type mockConstructorTestingTNewHooks interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}
|
||||
|
||||
// NewHooks creates a new instance of Hooks. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
func NewHooks(t mockConstructorTestingTNewHooks) *Hooks {
|
||||
mock := &Hooks{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user