Update mocks
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
884be62a4d
commit
55b4e74066
6 changed files with 404 additions and 119 deletions
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.42.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
|
@ -14,6 +14,24 @@ type Store struct {
|
|||
mock.Mock
|
||||
}
|
||||
|
||||
// AddEntityEvent provides a mock function with given fields: ctx, entity, event, eventLevel, statusMessage, maxEvents
|
||||
func (_m *Store) AddEntityEvent(ctx context.Context, entity params.GithubEntity, event params.EventType, eventLevel params.EventLevel, statusMessage string, maxEvents int) error {
|
||||
ret := _m.Called(ctx, entity, event, eventLevel, statusMessage, maxEvents)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for AddEntityEvent")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, params.GithubEntity, params.EventType, params.EventLevel, string, int) error); ok {
|
||||
r0 = rf(ctx, entity, event, eventLevel, statusMessage, maxEvents)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// AddInstanceEvent provides a mock function with given fields: ctx, instanceName, event, eventLevel, eventMessage
|
||||
func (_m *Store) AddInstanceEvent(ctx context.Context, instanceName string, event params.EventType, eventLevel params.EventLevel, eventMessage string) error {
|
||||
ret := _m.Called(ctx, instanceName, event, eventLevel, eventMessage)
|
||||
|
|
@ -50,7 +68,7 @@ func (_m *Store) BreakLockJobIsQueued(ctx context.Context, jobID int64) error {
|
|||
return r0
|
||||
}
|
||||
|
||||
// ControllerInfo provides a mock function with given fields:
|
||||
// ControllerInfo provides a mock function with no fields
|
||||
func (_m *Store) ControllerInfo() (params.ControllerInfo, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -134,6 +152,34 @@ func (_m *Store) CreateEntityPool(ctx context.Context, entity params.GithubEntit
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// CreateEntityScaleSet provides a mock function with given fields: _a0, entity, param
|
||||
func (_m *Store) CreateEntityScaleSet(_a0 context.Context, entity params.GithubEntity, param params.CreateScaleSetParams) (params.ScaleSet, error) {
|
||||
ret := _m.Called(_a0, entity, param)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CreateEntityScaleSet")
|
||||
}
|
||||
|
||||
var r0 params.ScaleSet
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, params.GithubEntity, params.CreateScaleSetParams) (params.ScaleSet, error)); ok {
|
||||
return rf(_a0, entity, param)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, params.GithubEntity, params.CreateScaleSetParams) params.ScaleSet); ok {
|
||||
r0 = rf(_a0, entity, param)
|
||||
} else {
|
||||
r0 = ret.Get(0).(params.ScaleSet)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, params.GithubEntity, params.CreateScaleSetParams) error); ok {
|
||||
r1 = rf(_a0, entity, param)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// CreateGithubCredentials provides a mock function with given fields: ctx, param
|
||||
func (_m *Store) CreateGithubCredentials(ctx context.Context, param params.CreateGithubCredentialsParams) (params.GithubCredentials, error) {
|
||||
ret := _m.Called(ctx, param)
|
||||
|
|
@ -302,6 +348,34 @@ func (_m *Store) CreateRepository(ctx context.Context, owner string, name string
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// CreateScaleSetInstance provides a mock function with given fields: _a0, scaleSetID, param
|
||||
func (_m *Store) CreateScaleSetInstance(_a0 context.Context, scaleSetID uint, param params.CreateInstanceParams) (params.Instance, error) {
|
||||
ret := _m.Called(_a0, scaleSetID, param)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CreateScaleSetInstance")
|
||||
}
|
||||
|
||||
var r0 params.Instance
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, uint, params.CreateInstanceParams) (params.Instance, error)); ok {
|
||||
return rf(_a0, scaleSetID, param)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, uint, params.CreateInstanceParams) params.Instance); ok {
|
||||
r0 = rf(_a0, scaleSetID, param)
|
||||
} else {
|
||||
r0 = ret.Get(0).(params.Instance)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, uint, params.CreateInstanceParams) error); ok {
|
||||
r1 = rf(_a0, scaleSetID, param)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// CreateUser provides a mock function with given fields: ctx, user
|
||||
func (_m *Store) CreateUser(ctx context.Context, user params.NewUserParams) (params.User, error) {
|
||||
ret := _m.Called(ctx, user)
|
||||
|
|
@ -438,6 +512,24 @@ func (_m *Store) DeleteInstance(ctx context.Context, poolID string, instanceName
|
|||
return r0
|
||||
}
|
||||
|
||||
// DeleteInstanceByName provides a mock function with given fields: ctx, instanceName
|
||||
func (_m *Store) DeleteInstanceByName(ctx context.Context, instanceName string) error {
|
||||
ret := _m.Called(ctx, instanceName)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteInstanceByName")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
||||
r0 = rf(ctx, instanceName)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteJob provides a mock function with given fields: ctx, jobID
|
||||
func (_m *Store) DeleteJob(ctx context.Context, jobID int64) error {
|
||||
ret := _m.Called(ctx, jobID)
|
||||
|
|
@ -510,6 +602,24 @@ func (_m *Store) DeleteRepository(ctx context.Context, repoID string) error {
|
|||
return r0
|
||||
}
|
||||
|
||||
// DeleteScaleSetByID provides a mock function with given fields: ctx, scaleSetID
|
||||
func (_m *Store) DeleteScaleSetByID(ctx context.Context, scaleSetID uint) error {
|
||||
ret := _m.Called(ctx, scaleSetID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteScaleSetByID")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, uint) error); ok {
|
||||
r0 = rf(ctx, scaleSetID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// FindPoolsMatchingAllTags provides a mock function with given fields: ctx, entityType, entityID, tags
|
||||
func (_m *Store) FindPoolsMatchingAllTags(ctx context.Context, entityType params.GithubEntityType, entityID string, tags []string) ([]params.Pool, error) {
|
||||
ret := _m.Called(ctx, entityType, entityID, tags)
|
||||
|
|
@ -736,6 +846,34 @@ func (_m *Store) GetGithubEndpoint(ctx context.Context, name string) (params.Git
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// GetGithubEntity provides a mock function with given fields: _a0, entityType, entityID
|
||||
func (_m *Store) GetGithubEntity(_a0 context.Context, entityType params.GithubEntityType, entityID string) (params.GithubEntity, error) {
|
||||
ret := _m.Called(_a0, entityType, entityID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetGithubEntity")
|
||||
}
|
||||
|
||||
var r0 params.GithubEntity
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, params.GithubEntityType, string) (params.GithubEntity, error)); ok {
|
||||
return rf(_a0, entityType, entityID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, params.GithubEntityType, string) params.GithubEntity); ok {
|
||||
r0 = rf(_a0, entityType, entityID)
|
||||
} else {
|
||||
r0 = ret.Get(0).(params.GithubEntity)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, params.GithubEntityType, string) error); ok {
|
||||
r1 = rf(_a0, entityType, entityID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetInstanceByName provides a mock function with given fields: ctx, instanceName
|
||||
func (_m *Store) GetInstanceByName(ctx context.Context, instanceName string) (params.Instance, error) {
|
||||
ret := _m.Called(ctx, instanceName)
|
||||
|
|
@ -960,6 +1098,34 @@ func (_m *Store) GetRepositoryByID(ctx context.Context, repoID string) (params.R
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// GetScaleSetByID provides a mock function with given fields: ctx, scaleSet
|
||||
func (_m *Store) GetScaleSetByID(ctx context.Context, scaleSet uint) (params.ScaleSet, error) {
|
||||
ret := _m.Called(ctx, scaleSet)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetScaleSetByID")
|
||||
}
|
||||
|
||||
var r0 params.ScaleSet
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, uint) (params.ScaleSet, error)); ok {
|
||||
return rf(ctx, scaleSet)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, uint) params.ScaleSet); ok {
|
||||
r0 = rf(ctx, scaleSet)
|
||||
} else {
|
||||
r0 = ret.Get(0).(params.ScaleSet)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, uint) error); ok {
|
||||
r1 = rf(ctx, scaleSet)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetUser provides a mock function with given fields: ctx, user
|
||||
func (_m *Store) GetUser(ctx context.Context, user string) (params.User, error) {
|
||||
ret := _m.Called(ctx, user)
|
||||
|
|
@ -1034,7 +1200,7 @@ func (_m *Store) HasAdminUser(ctx context.Context) bool {
|
|||
return r0
|
||||
}
|
||||
|
||||
// InitController provides a mock function with given fields:
|
||||
// InitController provides a mock function with no fields
|
||||
func (_m *Store) InitController() (params.ControllerInfo, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -1152,6 +1318,36 @@ func (_m *Store) ListAllPools(ctx context.Context) ([]params.Pool, error) {
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// ListAllScaleSets provides a mock function with given fields: ctx
|
||||
func (_m *Store) ListAllScaleSets(ctx context.Context) ([]params.ScaleSet, error) {
|
||||
ret := _m.Called(ctx)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListAllScaleSets")
|
||||
}
|
||||
|
||||
var r0 []params.ScaleSet
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context) ([]params.ScaleSet, error)); ok {
|
||||
return rf(ctx)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context) []params.ScaleSet); ok {
|
||||
r0 = rf(ctx)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]params.ScaleSet)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
|
||||
r1 = rf(ctx)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ListEnterprises provides a mock function with given fields: ctx
|
||||
func (_m *Store) ListEnterprises(ctx context.Context) ([]params.Enterprise, error) {
|
||||
ret := _m.Called(ctx)
|
||||
|
|
@ -1272,6 +1468,36 @@ func (_m *Store) ListEntityPools(ctx context.Context, entity params.GithubEntity
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// ListEntityScaleSets provides a mock function with given fields: _a0, entity
|
||||
func (_m *Store) ListEntityScaleSets(_a0 context.Context, entity params.GithubEntity) ([]params.ScaleSet, error) {
|
||||
ret := _m.Called(_a0, entity)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListEntityScaleSets")
|
||||
}
|
||||
|
||||
var r0 []params.ScaleSet
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, params.GithubEntity) ([]params.ScaleSet, error)); ok {
|
||||
return rf(_a0, entity)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, params.GithubEntity) []params.ScaleSet); ok {
|
||||
r0 = rf(_a0, entity)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]params.ScaleSet)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, params.GithubEntity) error); ok {
|
||||
r1 = rf(_a0, entity)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ListGithubCredentials provides a mock function with given fields: ctx
|
||||
func (_m *Store) ListGithubCredentials(ctx context.Context) ([]params.GithubCredentials, error) {
|
||||
ret := _m.Called(ctx)
|
||||
|
|
@ -1452,6 +1678,36 @@ func (_m *Store) ListRepositories(ctx context.Context) ([]params.Repository, err
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// ListScaleSetInstances provides a mock function with given fields: _a0, scalesetID
|
||||
func (_m *Store) ListScaleSetInstances(_a0 context.Context, scalesetID uint) ([]params.Instance, error) {
|
||||
ret := _m.Called(_a0, scalesetID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListScaleSetInstances")
|
||||
}
|
||||
|
||||
var r0 []params.Instance
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, uint) ([]params.Instance, error)); ok {
|
||||
return rf(_a0, scalesetID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, uint) []params.Instance); ok {
|
||||
r0 = rf(_a0, scalesetID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]params.Instance)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, uint) error); ok {
|
||||
r1 = rf(_a0, scalesetID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// LockJob provides a mock function with given fields: ctx, jobID, entityID
|
||||
func (_m *Store) LockJob(ctx context.Context, jobID int64, entityID string) error {
|
||||
ret := _m.Called(ctx, jobID, entityID)
|
||||
|
|
@ -1498,6 +1754,42 @@ func (_m *Store) PoolInstanceCount(ctx context.Context, poolID string) (int64, e
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// SetScaleSetDesiredRunnerCount provides a mock function with given fields: ctx, scaleSetID, desiredRunnerCount
|
||||
func (_m *Store) SetScaleSetDesiredRunnerCount(ctx context.Context, scaleSetID uint, desiredRunnerCount int) error {
|
||||
ret := _m.Called(ctx, scaleSetID, desiredRunnerCount)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SetScaleSetDesiredRunnerCount")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, uint, int) error); ok {
|
||||
r0 = rf(ctx, scaleSetID, desiredRunnerCount)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// SetScaleSetLastMessageID provides a mock function with given fields: ctx, scaleSetID, lastMessageID
|
||||
func (_m *Store) SetScaleSetLastMessageID(ctx context.Context, scaleSetID uint, lastMessageID int64) error {
|
||||
ret := _m.Called(ctx, scaleSetID, lastMessageID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for SetScaleSetLastMessageID")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, uint, int64) error); ok {
|
||||
r0 = rf(ctx, scaleSetID, lastMessageID)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// UnlockJob provides a mock function with given fields: ctx, jobID, entityID
|
||||
func (_m *Store) UnlockJob(ctx context.Context, jobID int64, entityID string) error {
|
||||
ret := _m.Called(ctx, jobID, entityID)
|
||||
|
|
@ -1600,6 +1892,34 @@ func (_m *Store) UpdateEntityPool(ctx context.Context, entity params.GithubEntit
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateEntityScaleSet provides a mock function with given fields: _a0, entity, scaleSetID, param, callback
|
||||
func (_m *Store) UpdateEntityScaleSet(_a0 context.Context, entity params.GithubEntity, scaleSetID uint, param params.UpdateScaleSetParams, callback func(params.ScaleSet, params.ScaleSet) error) (params.ScaleSet, error) {
|
||||
ret := _m.Called(_a0, entity, scaleSetID, param, callback)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for UpdateEntityScaleSet")
|
||||
}
|
||||
|
||||
var r0 params.ScaleSet
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, params.GithubEntity, uint, params.UpdateScaleSetParams, func(params.ScaleSet, params.ScaleSet) error) (params.ScaleSet, error)); ok {
|
||||
return rf(_a0, entity, scaleSetID, param, callback)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, params.GithubEntity, uint, params.UpdateScaleSetParams, func(params.ScaleSet, params.ScaleSet) error) params.ScaleSet); ok {
|
||||
r0 = rf(_a0, entity, scaleSetID, param, callback)
|
||||
} else {
|
||||
r0 = ret.Get(0).(params.ScaleSet)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, params.GithubEntity, uint, params.UpdateScaleSetParams, func(params.ScaleSet, params.ScaleSet) error) error); ok {
|
||||
r1 = rf(_a0, entity, scaleSetID, param, callback)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateGithubCredentials provides a mock function with given fields: ctx, id, param
|
||||
func (_m *Store) UpdateGithubCredentials(ctx context.Context, id uint, param params.UpdateGithubCredentialsParams) (params.GithubCredentials, error) {
|
||||
ret := _m.Called(ctx, id, param)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.42.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
|
@ -117,7 +117,7 @@ func (_m *GithubClient) DeleteEntityHook(ctx context.Context, id int64) (*github
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// GetEntity provides a mock function with given fields:
|
||||
// GetEntity provides a mock function with no fields
|
||||
func (_m *GithubClient) GetEntity() params.GithubEntity {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -243,7 +243,7 @@ func (_m *GithubClient) GetWorkflowJobByID(ctx context.Context, owner string, re
|
|||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// GithubBaseURL provides a mock function with given fields:
|
||||
// GithubBaseURL provides a mock function with no fields
|
||||
func (_m *GithubClient) GithubBaseURL() *url.URL {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -411,33 +411,21 @@ func (_m *GithubClient) PingEntityHook(ctx context.Context, id int64) (*github.R
|
|||
}
|
||||
|
||||
// RemoveEntityRunner provides a mock function with given fields: ctx, runnerID
|
||||
func (_m *GithubClient) RemoveEntityRunner(ctx context.Context, runnerID int64) (*github.Response, error) {
|
||||
func (_m *GithubClient) RemoveEntityRunner(ctx context.Context, runnerID int64) error {
|
||||
ret := _m.Called(ctx, runnerID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveEntityRunner")
|
||||
}
|
||||
|
||||
var r0 *github.Response
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int64) (*github.Response, error)); ok {
|
||||
return rf(ctx, runnerID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int64) *github.Response); ok {
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int64) error); ok {
|
||||
r0 = rf(ctx, runnerID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*github.Response)
|
||||
}
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok {
|
||||
r1 = rf(ctx, runnerID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
return r0
|
||||
}
|
||||
|
||||
// NewGithubClient creates a new instance of GithubClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.42.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
|
@ -117,7 +117,7 @@ func (_m *GithubEntityOperations) DeleteEntityHook(ctx context.Context, id int64
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// GetEntity provides a mock function with given fields:
|
||||
// GetEntity provides a mock function with no fields
|
||||
func (_m *GithubEntityOperations) GetEntity() params.GithubEntity {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ func (_m *GithubEntityOperations) GetEntityJITConfig(ctx context.Context, instan
|
|||
return r0, r1, r2
|
||||
}
|
||||
|
||||
// GithubBaseURL provides a mock function with given fields:
|
||||
// GithubBaseURL provides a mock function with no fields
|
||||
func (_m *GithubEntityOperations) GithubBaseURL() *url.URL {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -372,33 +372,21 @@ func (_m *GithubEntityOperations) PingEntityHook(ctx context.Context, id int64)
|
|||
}
|
||||
|
||||
// RemoveEntityRunner provides a mock function with given fields: ctx, runnerID
|
||||
func (_m *GithubEntityOperations) RemoveEntityRunner(ctx context.Context, runnerID int64) (*github.Response, error) {
|
||||
func (_m *GithubEntityOperations) RemoveEntityRunner(ctx context.Context, runnerID int64) error {
|
||||
ret := _m.Called(ctx, runnerID)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveEntityRunner")
|
||||
}
|
||||
|
||||
var r0 *github.Response
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int64) (*github.Response, error)); ok {
|
||||
return rf(ctx, runnerID)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int64) *github.Response); ok {
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, int64) error); ok {
|
||||
r0 = rf(ctx, runnerID)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*github.Response)
|
||||
}
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok {
|
||||
r1 = rf(ctx, runnerID)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
return r0
|
||||
}
|
||||
|
||||
// NewGithubEntityOperations creates a new instance of GithubEntityOperations. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.42.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
|
@ -14,24 +14,6 @@ type PoolManager struct {
|
|||
mock.Mock
|
||||
}
|
||||
|
||||
// DeleteRunner provides a mock function with given fields: runner, forceRemove, bypassGHUnauthorizedError
|
||||
func (_m *PoolManager) DeleteRunner(runner params.Instance, forceRemove bool, bypassGHUnauthorizedError bool) error {
|
||||
ret := _m.Called(runner, forceRemove, bypassGHUnauthorizedError)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteRunner")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(params.Instance, bool, bool) error); ok {
|
||||
r0 = rf(runner, forceRemove, bypassGHUnauthorizedError)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// GetWebhookInfo provides a mock function with given fields: ctx
|
||||
func (_m *PoolManager) GetWebhookInfo(ctx context.Context) (params.HookInfo, error) {
|
||||
ret := _m.Called(ctx)
|
||||
|
|
@ -60,7 +42,7 @@ func (_m *PoolManager) GetWebhookInfo(ctx context.Context) (params.HookInfo, err
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// GithubRunnerRegistrationToken provides a mock function with given fields:
|
||||
// GithubRunnerRegistrationToken provides a mock function with no fields
|
||||
func (_m *PoolManager) GithubRunnerRegistrationToken() (string, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -106,7 +88,7 @@ func (_m *PoolManager) HandleWorkflowJob(job params.WorkflowJob) error {
|
|||
return r0
|
||||
}
|
||||
|
||||
// ID provides a mock function with given fields:
|
||||
// ID provides a mock function with no fields
|
||||
func (_m *PoolManager) ID() string {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -152,7 +134,7 @@ func (_m *PoolManager) InstallWebhook(ctx context.Context, param params.InstallW
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// RootCABundle provides a mock function with given fields:
|
||||
// RootCABundle provides a mock function with no fields
|
||||
func (_m *PoolManager) RootCABundle() (params.CertificateBundle, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -180,7 +162,12 @@ func (_m *PoolManager) RootCABundle() (params.CertificateBundle, error) {
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// Start provides a mock function with given fields:
|
||||
// SetPoolRunningState provides a mock function with given fields: isRunning, failureReason
|
||||
func (_m *PoolManager) SetPoolRunningState(isRunning bool, failureReason string) {
|
||||
_m.Called(isRunning, failureReason)
|
||||
}
|
||||
|
||||
// Start provides a mock function with no fields
|
||||
func (_m *PoolManager) Start() error {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -198,7 +185,7 @@ func (_m *PoolManager) Start() error {
|
|||
return r0
|
||||
}
|
||||
|
||||
// Status provides a mock function with given fields:
|
||||
// Status provides a mock function with no fields
|
||||
func (_m *PoolManager) Status() params.PoolManagerStatus {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -216,7 +203,7 @@ func (_m *PoolManager) Status() params.PoolManagerStatus {
|
|||
return r0
|
||||
}
|
||||
|
||||
// Stop provides a mock function with given fields:
|
||||
// Stop provides a mock function with no fields
|
||||
func (_m *PoolManager) Stop() error {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -252,7 +239,7 @@ func (_m *PoolManager) UninstallWebhook(ctx context.Context) error {
|
|||
return r0
|
||||
}
|
||||
|
||||
// Wait provides a mock function with given fields:
|
||||
// Wait provides a mock function with no fields
|
||||
func (_m *PoolManager) Wait() error {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -270,7 +257,7 @@ func (_m *PoolManager) Wait() error {
|
|||
return r0
|
||||
}
|
||||
|
||||
// WebhookSecret provides a mock function with given fields:
|
||||
// WebhookSecret provides a mock function with no fields
|
||||
func (_m *PoolManager) WebhookSecret() string {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
// Code generated by mockery v2.42.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
common "github.com/cloudbase/garm/runner/common"
|
||||
|
||||
garm_provider_commonparams "github.com/cloudbase/garm-provider-common/params"
|
||||
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
|
||||
params "github.com/cloudbase/garm/params"
|
||||
"github.com/cloudbase/garm/runner/common"
|
||||
)
|
||||
|
||||
// Provider is an autogenerated mock type for the Provider type
|
||||
|
|
@ -17,7 +19,7 @@ type Provider struct {
|
|||
mock.Mock
|
||||
}
|
||||
|
||||
// AsParams provides a mock function with given fields:
|
||||
// AsParams provides a mock function with no fields
|
||||
func (_m *Provider) AsParams() params.Provider {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -35,9 +37,9 @@ func (_m *Provider) AsParams() params.Provider {
|
|||
return r0
|
||||
}
|
||||
|
||||
// CreateInstance provides a mock function with given fields: ctx, bootstrapParams
|
||||
// CreateInstance provides a mock function with given fields: ctx, bootstrapParams, createInstanceParams
|
||||
func (_m *Provider) CreateInstance(ctx context.Context, bootstrapParams garm_provider_commonparams.BootstrapInstance, createInstanceParams common.CreateInstanceParams) (garm_provider_commonparams.ProviderInstance, error) {
|
||||
ret := _m.Called(ctx, bootstrapParams)
|
||||
ret := _m.Called(ctx, bootstrapParams, createInstanceParams)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CreateInstance")
|
||||
|
|
@ -45,17 +47,17 @@ func (_m *Provider) CreateInstance(ctx context.Context, bootstrapParams garm_pro
|
|||
|
||||
var r0 garm_provider_commonparams.ProviderInstance
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, garm_provider_commonparams.BootstrapInstance) (garm_provider_commonparams.ProviderInstance, error)); ok {
|
||||
return rf(ctx, bootstrapParams)
|
||||
if rf, ok := ret.Get(0).(func(context.Context, garm_provider_commonparams.BootstrapInstance, common.CreateInstanceParams) (garm_provider_commonparams.ProviderInstance, error)); ok {
|
||||
return rf(ctx, bootstrapParams, createInstanceParams)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, garm_provider_commonparams.BootstrapInstance) garm_provider_commonparams.ProviderInstance); ok {
|
||||
r0 = rf(ctx, bootstrapParams)
|
||||
if rf, ok := ret.Get(0).(func(context.Context, garm_provider_commonparams.BootstrapInstance, common.CreateInstanceParams) garm_provider_commonparams.ProviderInstance); ok {
|
||||
r0 = rf(ctx, bootstrapParams, createInstanceParams)
|
||||
} else {
|
||||
r0 = ret.Get(0).(garm_provider_commonparams.ProviderInstance)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, garm_provider_commonparams.BootstrapInstance) error); ok {
|
||||
r1 = rf(ctx, bootstrapParams)
|
||||
if rf, ok := ret.Get(1).(func(context.Context, garm_provider_commonparams.BootstrapInstance, common.CreateInstanceParams) error); ok {
|
||||
r1 = rf(ctx, bootstrapParams, createInstanceParams)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
|
@ -63,17 +65,17 @@ func (_m *Provider) CreateInstance(ctx context.Context, bootstrapParams garm_pro
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// DeleteInstance provides a mock function with given fields: ctx, instance
|
||||
// DeleteInstance provides a mock function with given fields: ctx, instance, deleteInstanceParams
|
||||
func (_m *Provider) DeleteInstance(ctx context.Context, instance string, deleteInstanceParams common.DeleteInstanceParams) error {
|
||||
ret := _m.Called(ctx, instance)
|
||||
ret := _m.Called(ctx, instance, deleteInstanceParams)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for DeleteInstance")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
||||
r0 = rf(ctx, instance)
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, common.DeleteInstanceParams) error); ok {
|
||||
r0 = rf(ctx, instance, deleteInstanceParams)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
|
@ -81,7 +83,7 @@ func (_m *Provider) DeleteInstance(ctx context.Context, instance string, deleteI
|
|||
return r0
|
||||
}
|
||||
|
||||
// DisableJITConfig provides a mock function with given fields:
|
||||
// DisableJITConfig provides a mock function with no fields
|
||||
func (_m *Provider) DisableJITConfig() bool {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -99,9 +101,9 @@ func (_m *Provider) DisableJITConfig() bool {
|
|||
return r0
|
||||
}
|
||||
|
||||
// GetInstance provides a mock function with given fields: ctx, instance
|
||||
// GetInstance provides a mock function with given fields: ctx, instance, getInstanceParams
|
||||
func (_m *Provider) GetInstance(ctx context.Context, instance string, getInstanceParams common.GetInstanceParams) (garm_provider_commonparams.ProviderInstance, error) {
|
||||
ret := _m.Called(ctx, instance)
|
||||
ret := _m.Called(ctx, instance, getInstanceParams)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetInstance")
|
||||
|
|
@ -109,17 +111,17 @@ func (_m *Provider) GetInstance(ctx context.Context, instance string, getInstanc
|
|||
|
||||
var r0 garm_provider_commonparams.ProviderInstance
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) (garm_provider_commonparams.ProviderInstance, error)); ok {
|
||||
return rf(ctx, instance)
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, common.GetInstanceParams) (garm_provider_commonparams.ProviderInstance, error)); ok {
|
||||
return rf(ctx, instance, getInstanceParams)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) garm_provider_commonparams.ProviderInstance); ok {
|
||||
r0 = rf(ctx, instance)
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, common.GetInstanceParams) garm_provider_commonparams.ProviderInstance); ok {
|
||||
r0 = rf(ctx, instance, getInstanceParams)
|
||||
} else {
|
||||
r0 = ret.Get(0).(garm_provider_commonparams.ProviderInstance)
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = rf(ctx, instance)
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string, common.GetInstanceParams) error); ok {
|
||||
r1 = rf(ctx, instance, getInstanceParams)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
|
@ -127,9 +129,9 @@ func (_m *Provider) GetInstance(ctx context.Context, instance string, getInstanc
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// ListInstances provides a mock function with given fields: ctx, poolID
|
||||
// ListInstances provides a mock function with given fields: ctx, poolID, listInstancesParams
|
||||
func (_m *Provider) ListInstances(ctx context.Context, poolID string, listInstancesParams common.ListInstancesParams) ([]garm_provider_commonparams.ProviderInstance, error) {
|
||||
ret := _m.Called(ctx, poolID)
|
||||
ret := _m.Called(ctx, poolID, listInstancesParams)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for ListInstances")
|
||||
|
|
@ -137,19 +139,19 @@ func (_m *Provider) ListInstances(ctx context.Context, poolID string, listInstan
|
|||
|
||||
var r0 []garm_provider_commonparams.ProviderInstance
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) ([]garm_provider_commonparams.ProviderInstance, error)); ok {
|
||||
return rf(ctx, poolID)
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, common.ListInstancesParams) ([]garm_provider_commonparams.ProviderInstance, error)); ok {
|
||||
return rf(ctx, poolID, listInstancesParams)
|
||||
}
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) []garm_provider_commonparams.ProviderInstance); ok {
|
||||
r0 = rf(ctx, poolID)
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, common.ListInstancesParams) []garm_provider_commonparams.ProviderInstance); ok {
|
||||
r0 = rf(ctx, poolID, listInstancesParams)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]garm_provider_commonparams.ProviderInstance)
|
||||
}
|
||||
}
|
||||
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
||||
r1 = rf(ctx, poolID)
|
||||
if rf, ok := ret.Get(1).(func(context.Context, string, common.ListInstancesParams) error); ok {
|
||||
r1 = rf(ctx, poolID, listInstancesParams)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
|
@ -157,17 +159,17 @@ func (_m *Provider) ListInstances(ctx context.Context, poolID string, listInstan
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// RemoveAllInstances provides a mock function with given fields: ctx
|
||||
func (_m *Provider) RemoveAllInstances(ctx context.Context, removeAllInstances common.RemoveAllInstancesParams) error {
|
||||
ret := _m.Called(ctx)
|
||||
// RemoveAllInstances provides a mock function with given fields: ctx, removeAllInstancesParams
|
||||
func (_m *Provider) RemoveAllInstances(ctx context.Context, removeAllInstancesParams common.RemoveAllInstancesParams) error {
|
||||
ret := _m.Called(ctx, removeAllInstancesParams)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for RemoveAllInstances")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context) error); ok {
|
||||
r0 = rf(ctx)
|
||||
if rf, ok := ret.Get(0).(func(context.Context, common.RemoveAllInstancesParams) error); ok {
|
||||
r0 = rf(ctx, removeAllInstancesParams)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
|
@ -175,17 +177,17 @@ func (_m *Provider) RemoveAllInstances(ctx context.Context, removeAllInstances c
|
|||
return r0
|
||||
}
|
||||
|
||||
// Start provides a mock function with given fields: ctx, instance
|
||||
// Start provides a mock function with given fields: ctx, instance, startParams
|
||||
func (_m *Provider) Start(ctx context.Context, instance string, startParams common.StartParams) error {
|
||||
ret := _m.Called(ctx, instance)
|
||||
ret := _m.Called(ctx, instance, startParams)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Start")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
||||
r0 = rf(ctx, instance)
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, common.StartParams) error); ok {
|
||||
r0 = rf(ctx, instance, startParams)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
|
@ -193,17 +195,17 @@ func (_m *Provider) Start(ctx context.Context, instance string, startParams comm
|
|||
return r0
|
||||
}
|
||||
|
||||
// Stop provides a mock function with given fields: ctx, instance
|
||||
// Stop provides a mock function with given fields: ctx, instance, stopParams
|
||||
func (_m *Provider) Stop(ctx context.Context, instance string, stopParams common.StopParams) error {
|
||||
ret := _m.Called(ctx, instance)
|
||||
ret := _m.Called(ctx, instance, stopParams)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for Stop")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
||||
r0 = rf(ctx, instance)
|
||||
if rf, ok := ret.Get(0).(func(context.Context, string, common.StopParams) error); ok {
|
||||
r0 = rf(ctx, instance, stopParams)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by mockery v2.42.0. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.3. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
|
@ -193,7 +193,7 @@ func (_m *PoolManagerController) GetEnterprisePoolManager(enterprise params.Ente
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// GetEnterprisePoolManagers provides a mock function with given fields:
|
||||
// GetEnterprisePoolManagers provides a mock function with no fields
|
||||
func (_m *PoolManagerController) GetEnterprisePoolManagers() (map[string]common.PoolManager, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -253,7 +253,7 @@ func (_m *PoolManagerController) GetOrgPoolManager(org params.Organization) (com
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOrgPoolManagers provides a mock function with given fields:
|
||||
// GetOrgPoolManagers provides a mock function with no fields
|
||||
func (_m *PoolManagerController) GetOrgPoolManagers() (map[string]common.PoolManager, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
@ -313,7 +313,7 @@ func (_m *PoolManagerController) GetRepoPoolManager(repo params.Repository) (com
|
|||
return r0, r1
|
||||
}
|
||||
|
||||
// GetRepoPoolManagers provides a mock function with given fields:
|
||||
// GetRepoPoolManagers provides a mock function with no fields
|
||||
func (_m *PoolManagerController) GetRepoPoolManagers() (map[string]common.PoolManager, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue