jobstore (#15250)
* Migration completed * Modify test case * Update en.json * Fix layers * Lint: remove unnecessary use of sprint * trigger CI * fix error * Fixes * fix test Co-authored-by: Rodrigo Villablanca <villa061004@gmail.com> Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
b451b3cf86
Коммит
78766625df
@@ -15,7 +15,7 @@ type JobStore struct {
|
||||
}
|
||||
|
||||
// Delete provides a mock function with given fields: id
|
||||
func (_m *JobStore) Delete(id string) (string, *model.AppError) {
|
||||
func (_m *JobStore) Delete(id string) (string, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
var r0 string
|
||||
@@ -25,20 +25,18 @@ func (_m *JobStore) Delete(id string) (string, *model.AppError) {
|
||||
r0 = ret.Get(0).(string)
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: id
|
||||
func (_m *JobStore) Get(id string) (*model.Job, *model.AppError) {
|
||||
func (_m *JobStore) Get(id string) (*model.Job, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
var r0 *model.Job
|
||||
@@ -50,20 +48,18 @@ func (_m *JobStore) Get(id string) (*model.Job, *model.AppError) {
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllByStatus provides a mock function with given fields: status
|
||||
func (_m *JobStore) GetAllByStatus(status string) ([]*model.Job, *model.AppError) {
|
||||
func (_m *JobStore) GetAllByStatus(status string) ([]*model.Job, error) {
|
||||
ret := _m.Called(status)
|
||||
|
||||
var r0 []*model.Job
|
||||
@@ -75,20 +71,18 @@ func (_m *JobStore) GetAllByStatus(status string) ([]*model.Job, *model.AppError
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(status)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllByType provides a mock function with given fields: jobType
|
||||
func (_m *JobStore) GetAllByType(jobType string) ([]*model.Job, *model.AppError) {
|
||||
func (_m *JobStore) GetAllByType(jobType string) ([]*model.Job, error) {
|
||||
ret := _m.Called(jobType)
|
||||
|
||||
var r0 []*model.Job
|
||||
@@ -100,20 +94,18 @@ func (_m *JobStore) GetAllByType(jobType string) ([]*model.Job, *model.AppError)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(jobType)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllByTypePage provides a mock function with given fields: jobType, offset, limit
|
||||
func (_m *JobStore) GetAllByTypePage(jobType string, offset int, limit int) ([]*model.Job, *model.AppError) {
|
||||
func (_m *JobStore) GetAllByTypePage(jobType string, offset int, limit int) ([]*model.Job, error) {
|
||||
ret := _m.Called(jobType, offset, limit)
|
||||
|
||||
var r0 []*model.Job
|
||||
@@ -125,20 +117,18 @@ func (_m *JobStore) GetAllByTypePage(jobType string, offset int, limit int) ([]*
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(jobType, offset, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetAllPage provides a mock function with given fields: offset, limit
|
||||
func (_m *JobStore) GetAllPage(offset int, limit int) ([]*model.Job, *model.AppError) {
|
||||
func (_m *JobStore) GetAllPage(offset int, limit int) ([]*model.Job, error) {
|
||||
ret := _m.Called(offset, limit)
|
||||
|
||||
var r0 []*model.Job
|
||||
@@ -150,20 +140,18 @@ func (_m *JobStore) GetAllPage(offset int, limit int) ([]*model.Job, *model.AppE
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(int, int) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(int, int) error); ok {
|
||||
r1 = rf(offset, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetCountByStatusAndType provides a mock function with given fields: status, jobType
|
||||
func (_m *JobStore) GetCountByStatusAndType(status string, jobType string) (int64, *model.AppError) {
|
||||
func (_m *JobStore) GetCountByStatusAndType(status string, jobType string) (int64, error) {
|
||||
ret := _m.Called(status, jobType)
|
||||
|
||||
var r0 int64
|
||||
@@ -173,20 +161,18 @@ func (_m *JobStore) GetCountByStatusAndType(status string, jobType string) (int6
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(status, jobType)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetNewestJobByStatusAndType provides a mock function with given fields: status, jobType
|
||||
func (_m *JobStore) GetNewestJobByStatusAndType(status string, jobType string) (*model.Job, *model.AppError) {
|
||||
func (_m *JobStore) GetNewestJobByStatusAndType(status string, jobType string) (*model.Job, error) {
|
||||
ret := _m.Called(status, jobType)
|
||||
|
||||
var r0 *model.Job
|
||||
@@ -198,20 +184,18 @@ func (_m *JobStore) GetNewestJobByStatusAndType(status string, jobType string) (
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(status, jobType)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetNewestJobByStatusesAndType provides a mock function with given fields: statuses, jobType
|
||||
func (_m *JobStore) GetNewestJobByStatusesAndType(statuses []string, jobType string) (*model.Job, *model.AppError) {
|
||||
func (_m *JobStore) GetNewestJobByStatusesAndType(statuses []string, jobType string) (*model.Job, error) {
|
||||
ret := _m.Called(statuses, jobType)
|
||||
|
||||
var r0 *model.Job
|
||||
@@ -223,20 +207,18 @@ func (_m *JobStore) GetNewestJobByStatusesAndType(statuses []string, jobType str
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func([]string, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func([]string, string) error); ok {
|
||||
r1 = rf(statuses, jobType)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: job
|
||||
func (_m *JobStore) Save(job *model.Job) (*model.Job, *model.AppError) {
|
||||
func (_m *JobStore) Save(job *model.Job) (*model.Job, error) {
|
||||
ret := _m.Called(job)
|
||||
|
||||
var r0 *model.Job
|
||||
@@ -248,20 +230,18 @@ func (_m *JobStore) Save(job *model.Job) (*model.Job, *model.AppError) {
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(*model.Job) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*model.Job) error); ok {
|
||||
r1 = rf(job)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateOptimistically provides a mock function with given fields: job, currentStatus
|
||||
func (_m *JobStore) UpdateOptimistically(job *model.Job, currentStatus string) (bool, *model.AppError) {
|
||||
func (_m *JobStore) UpdateOptimistically(job *model.Job, currentStatus string) (bool, error) {
|
||||
ret := _m.Called(job, currentStatus)
|
||||
|
||||
var r0 bool
|
||||
@@ -271,20 +251,18 @@ func (_m *JobStore) UpdateOptimistically(job *model.Job, currentStatus string) (
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(*model.Job, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*model.Job, string) error); ok {
|
||||
r1 = rf(job, currentStatus)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateStatus provides a mock function with given fields: id, status
|
||||
func (_m *JobStore) UpdateStatus(id string, status string) (*model.Job, *model.AppError) {
|
||||
func (_m *JobStore) UpdateStatus(id string, status string) (*model.Job, error) {
|
||||
ret := _m.Called(id, status)
|
||||
|
||||
var r0 *model.Job
|
||||
@@ -296,20 +274,18 @@ func (_m *JobStore) UpdateStatus(id string, status string) (*model.Job, *model.A
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(id, status)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateStatusOptimistically provides a mock function with given fields: id, currentStatus, newStatus
|
||||
func (_m *JobStore) UpdateStatusOptimistically(id string, currentStatus string, newStatus string) (bool, *model.AppError) {
|
||||
func (_m *JobStore) UpdateStatusOptimistically(id string, currentStatus string, newStatus string) (bool, error) {
|
||||
ret := _m.Called(id, currentStatus, newStatus)
|
||||
|
||||
var r0 bool
|
||||
@@ -319,13 +295,11 @@ func (_m *JobStore) UpdateStatusOptimistically(id string, currentStatus string,
|
||||
r0 = ret.Get(0).(bool)
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string, string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string, string) error); ok {
|
||||
r1 = rf(id, currentStatus, newStatus)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
|
||||
Ссылка в новой задаче
Block a user