diff --git a/Makefile b/Makefile index a64f81af3713..b583fa84f3de 100644 --- a/Makefile +++ b/Makefile @@ -281,7 +281,7 @@ swagger: \ $(GOPATH)/bin/mockery: - go install github.com/vektra/mockery/v2@v2.10.0 + go install github.com/vektra/mockery/v2@v2.26.0 $(GOPATH)/bin/controller-gen: go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1 $(GOPATH)/bin/go-to-protobuf: diff --git a/persist/sqldb/mocks/WorkflowArchive.go b/persist/sqldb/mocks/WorkflowArchive.go index 687c8b8810c2..08f43bc65ef6 100644 --- a/persist/sqldb/mocks/WorkflowArchive.go +++ b/persist/sqldb/mocks/WorkflowArchive.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.0. DO NOT EDIT. +// Code generated by mockery v2.26.0. DO NOT EDIT. package mocks @@ -35,13 +35,16 @@ func (_m *WorkflowArchive) CountWorkflows(namespace string, name string, namePre ret := _m.Called(namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements) var r0 int64 + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string, time.Time, time.Time, labels.Requirements) (int64, error)); ok { + return rf(namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements) + } if rf, ok := ret.Get(0).(func(string, string, string, time.Time, time.Time, labels.Requirements) int64); ok { r0 = rf(namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements) } else { r0 = ret.Get(0).(int64) } - var r1 error if rf, ok := ret.Get(1).(func(string, string, string, time.Time, time.Time, labels.Requirements) error); ok { r1 = rf(namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements) } else { @@ -84,6 +87,10 @@ func (_m *WorkflowArchive) GetWorkflow(uid string) (*v1alpha1.Workflow, error) { ret := _m.Called(uid) var r0 *v1alpha1.Workflow + var r1 error + if rf, ok := ret.Get(0).(func(string) (*v1alpha1.Workflow, error)); ok { + return rf(uid) + } if rf, ok := ret.Get(0).(func(string) *v1alpha1.Workflow); ok { r0 = rf(uid) } else { @@ -92,7 +99,6 @@ func (_m *WorkflowArchive) GetWorkflow(uid string) (*v1alpha1.Workflow, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(uid) } else { @@ -121,6 +127,10 @@ func (_m *WorkflowArchive) ListWorkflows(namespace string, name string, namePref ret := _m.Called(namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements, limit, offset) var r0 v1alpha1.Workflows + var r1 error + if rf, ok := ret.Get(0).(func(string, string, string, time.Time, time.Time, labels.Requirements, int, int) (v1alpha1.Workflows, error)); ok { + return rf(namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements, limit, offset) + } if rf, ok := ret.Get(0).(func(string, string, string, time.Time, time.Time, labels.Requirements, int, int) v1alpha1.Workflows); ok { r0 = rf(namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements, limit, offset) } else { @@ -129,7 +139,6 @@ func (_m *WorkflowArchive) ListWorkflows(namespace string, name string, namePref } } - var r1 error if rf, ok := ret.Get(1).(func(string, string, string, time.Time, time.Time, labels.Requirements, int, int) error); ok { r1 = rf(namespace, name, namePrefix, minStartAt, maxStartAt, labelRequirements, limit, offset) } else { @@ -144,6 +153,10 @@ func (_m *WorkflowArchive) ListWorkflowsLabelKeys() (*v1alpha1.LabelKeys, error) ret := _m.Called() var r0 *v1alpha1.LabelKeys + var r1 error + if rf, ok := ret.Get(0).(func() (*v1alpha1.LabelKeys, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() *v1alpha1.LabelKeys); ok { r0 = rf() } else { @@ -152,7 +165,6 @@ func (_m *WorkflowArchive) ListWorkflowsLabelKeys() (*v1alpha1.LabelKeys, error) } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -167,6 +179,10 @@ func (_m *WorkflowArchive) ListWorkflowsLabelValues(key string) (*v1alpha1.Label ret := _m.Called(key) var r0 *v1alpha1.LabelValues + var r1 error + if rf, ok := ret.Get(0).(func(string) (*v1alpha1.LabelValues, error)); ok { + return rf(key) + } if rf, ok := ret.Get(0).(func(string) *v1alpha1.LabelValues); ok { r0 = rf(key) } else { @@ -175,7 +191,6 @@ func (_m *WorkflowArchive) ListWorkflowsLabelValues(key string) (*v1alpha1.Label } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(key) } else { @@ -184,3 +199,18 @@ func (_m *WorkflowArchive) ListWorkflowsLabelValues(key string) (*v1alpha1.Label return r0, r1 } + +type mockConstructorTestingTNewWorkflowArchive interface { + mock.TestingT + Cleanup(func()) +} + +// NewWorkflowArchive creates a new instance of WorkflowArchive. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewWorkflowArchive(t mockConstructorTestingTNewWorkflowArchive) *WorkflowArchive { + mock := &WorkflowArchive{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/apiclient/workflow/mocks/WorkflowServiceClient.go b/pkg/apiclient/workflow/mocks/WorkflowServiceClient.go index 226a1c1a24ae..0e5ee916a994 100644 --- a/pkg/apiclient/workflow/mocks/WorkflowServiceClient.go +++ b/pkg/apiclient/workflow/mocks/WorkflowServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.0. DO NOT EDIT. +// Code generated by mockery v2.26.0. DO NOT EDIT. package mocks @@ -31,6 +31,10 @@ func (_m *WorkflowServiceClient) CreateWorkflow(ctx context.Context, in *workflo ret := _m.Called(_ca...) var r0 *v1alpha1.Workflow + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowCreateRequest, ...grpc.CallOption) (*v1alpha1.Workflow, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowCreateRequest, ...grpc.CallOption) *v1alpha1.Workflow); ok { r0 = rf(ctx, in, opts...) } else { @@ -39,7 +43,6 @@ func (_m *WorkflowServiceClient) CreateWorkflow(ctx context.Context, in *workflo } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WorkflowCreateRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -61,6 +64,10 @@ func (_m *WorkflowServiceClient) DeleteWorkflow(ctx context.Context, in *workflo ret := _m.Called(_ca...) var r0 *workflow.WorkflowDeleteResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowDeleteRequest, ...grpc.CallOption) (*workflow.WorkflowDeleteResponse, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowDeleteRequest, ...grpc.CallOption) *workflow.WorkflowDeleteResponse); ok { r0 = rf(ctx, in, opts...) } else { @@ -69,7 +76,6 @@ func (_m *WorkflowServiceClient) DeleteWorkflow(ctx context.Context, in *workflo } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WorkflowDeleteRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -91,6 +97,10 @@ func (_m *WorkflowServiceClient) GetWorkflow(ctx context.Context, in *workflow.W ret := _m.Called(_ca...) var r0 *v1alpha1.Workflow + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowGetRequest, ...grpc.CallOption) (*v1alpha1.Workflow, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowGetRequest, ...grpc.CallOption) *v1alpha1.Workflow); ok { r0 = rf(ctx, in, opts...) } else { @@ -99,7 +109,6 @@ func (_m *WorkflowServiceClient) GetWorkflow(ctx context.Context, in *workflow.W } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WorkflowGetRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -121,6 +130,10 @@ func (_m *WorkflowServiceClient) LintWorkflow(ctx context.Context, in *workflow. ret := _m.Called(_ca...) var r0 *v1alpha1.Workflow + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowLintRequest, ...grpc.CallOption) (*v1alpha1.Workflow, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowLintRequest, ...grpc.CallOption) *v1alpha1.Workflow); ok { r0 = rf(ctx, in, opts...) } else { @@ -129,7 +142,6 @@ func (_m *WorkflowServiceClient) LintWorkflow(ctx context.Context, in *workflow. } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WorkflowLintRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -151,6 +163,10 @@ func (_m *WorkflowServiceClient) ListWorkflows(ctx context.Context, in *workflow ret := _m.Called(_ca...) var r0 *v1alpha1.WorkflowList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowListRequest, ...grpc.CallOption) (*v1alpha1.WorkflowList, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowListRequest, ...grpc.CallOption) *v1alpha1.WorkflowList); ok { r0 = rf(ctx, in, opts...) } else { @@ -159,7 +175,6 @@ func (_m *WorkflowServiceClient) ListWorkflows(ctx context.Context, in *workflow } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WorkflowListRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -181,6 +196,10 @@ func (_m *WorkflowServiceClient) PodLogs(ctx context.Context, in *workflow.Workf ret := _m.Called(_ca...) var r0 workflow.WorkflowService_PodLogsClient + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowLogRequest, ...grpc.CallOption) (workflow.WorkflowService_PodLogsClient, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowLogRequest, ...grpc.CallOption) workflow.WorkflowService_PodLogsClient); ok { r0 = rf(ctx, in, opts...) } else { @@ -189,7 +208,6 @@ func (_m *WorkflowServiceClient) PodLogs(ctx context.Context, in *workflow.Workf } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WorkflowLogRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -211,6 +229,10 @@ func (_m *WorkflowServiceClient) ResubmitWorkflow(ctx context.Context, in *workf ret := _m.Called(_ca...) var r0 *v1alpha1.Workflow + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowResubmitRequest, ...grpc.CallOption) (*v1alpha1.Workflow, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowResubmitRequest, ...grpc.CallOption) *v1alpha1.Workflow); ok { r0 = rf(ctx, in, opts...) } else { @@ -219,7 +241,6 @@ func (_m *WorkflowServiceClient) ResubmitWorkflow(ctx context.Context, in *workf } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WorkflowResubmitRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -241,6 +262,10 @@ func (_m *WorkflowServiceClient) ResumeWorkflow(ctx context.Context, in *workflo ret := _m.Called(_ca...) var r0 *v1alpha1.Workflow + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowResumeRequest, ...grpc.CallOption) (*v1alpha1.Workflow, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowResumeRequest, ...grpc.CallOption) *v1alpha1.Workflow); ok { r0 = rf(ctx, in, opts...) } else { @@ -249,7 +274,6 @@ func (_m *WorkflowServiceClient) ResumeWorkflow(ctx context.Context, in *workflo } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WorkflowResumeRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -271,6 +295,10 @@ func (_m *WorkflowServiceClient) RetryWorkflow(ctx context.Context, in *workflow ret := _m.Called(_ca...) var r0 *v1alpha1.Workflow + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowRetryRequest, ...grpc.CallOption) (*v1alpha1.Workflow, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowRetryRequest, ...grpc.CallOption) *v1alpha1.Workflow); ok { r0 = rf(ctx, in, opts...) } else { @@ -279,7 +307,6 @@ func (_m *WorkflowServiceClient) RetryWorkflow(ctx context.Context, in *workflow } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WorkflowRetryRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -301,6 +328,10 @@ func (_m *WorkflowServiceClient) SetWorkflow(ctx context.Context, in *workflow.W ret := _m.Called(_ca...) var r0 *v1alpha1.Workflow + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowSetRequest, ...grpc.CallOption) (*v1alpha1.Workflow, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowSetRequest, ...grpc.CallOption) *v1alpha1.Workflow); ok { r0 = rf(ctx, in, opts...) } else { @@ -309,7 +340,6 @@ func (_m *WorkflowServiceClient) SetWorkflow(ctx context.Context, in *workflow.W } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WorkflowSetRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -331,6 +361,10 @@ func (_m *WorkflowServiceClient) StopWorkflow(ctx context.Context, in *workflow. ret := _m.Called(_ca...) var r0 *v1alpha1.Workflow + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowStopRequest, ...grpc.CallOption) (*v1alpha1.Workflow, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowStopRequest, ...grpc.CallOption) *v1alpha1.Workflow); ok { r0 = rf(ctx, in, opts...) } else { @@ -339,7 +373,6 @@ func (_m *WorkflowServiceClient) StopWorkflow(ctx context.Context, in *workflow. } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WorkflowStopRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -361,6 +394,10 @@ func (_m *WorkflowServiceClient) SubmitWorkflow(ctx context.Context, in *workflo ret := _m.Called(_ca...) var r0 *v1alpha1.Workflow + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowSubmitRequest, ...grpc.CallOption) (*v1alpha1.Workflow, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowSubmitRequest, ...grpc.CallOption) *v1alpha1.Workflow); ok { r0 = rf(ctx, in, opts...) } else { @@ -369,7 +406,6 @@ func (_m *WorkflowServiceClient) SubmitWorkflow(ctx context.Context, in *workflo } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WorkflowSubmitRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -391,6 +427,10 @@ func (_m *WorkflowServiceClient) SuspendWorkflow(ctx context.Context, in *workfl ret := _m.Called(_ca...) var r0 *v1alpha1.Workflow + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowSuspendRequest, ...grpc.CallOption) (*v1alpha1.Workflow, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowSuspendRequest, ...grpc.CallOption) *v1alpha1.Workflow); ok { r0 = rf(ctx, in, opts...) } else { @@ -399,7 +439,6 @@ func (_m *WorkflowServiceClient) SuspendWorkflow(ctx context.Context, in *workfl } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WorkflowSuspendRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -421,6 +460,10 @@ func (_m *WorkflowServiceClient) TerminateWorkflow(ctx context.Context, in *work ret := _m.Called(_ca...) var r0 *v1alpha1.Workflow + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowTerminateRequest, ...grpc.CallOption) (*v1alpha1.Workflow, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowTerminateRequest, ...grpc.CallOption) *v1alpha1.Workflow); ok { r0 = rf(ctx, in, opts...) } else { @@ -429,7 +472,6 @@ func (_m *WorkflowServiceClient) TerminateWorkflow(ctx context.Context, in *work } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WorkflowTerminateRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -451,6 +493,10 @@ func (_m *WorkflowServiceClient) WatchEvents(ctx context.Context, in *workflow.W ret := _m.Called(_ca...) var r0 workflow.WorkflowService_WatchEventsClient + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WatchEventsRequest, ...grpc.CallOption) (workflow.WorkflowService_WatchEventsClient, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WatchEventsRequest, ...grpc.CallOption) workflow.WorkflowService_WatchEventsClient); ok { r0 = rf(ctx, in, opts...) } else { @@ -459,7 +505,6 @@ func (_m *WorkflowServiceClient) WatchEvents(ctx context.Context, in *workflow.W } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WatchEventsRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -481,6 +526,10 @@ func (_m *WorkflowServiceClient) WatchWorkflows(ctx context.Context, in *workflo ret := _m.Called(_ca...) var r0 workflow.WorkflowService_WatchWorkflowsClient + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WatchWorkflowsRequest, ...grpc.CallOption) (workflow.WorkflowService_WatchWorkflowsClient, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WatchWorkflowsRequest, ...grpc.CallOption) workflow.WorkflowService_WatchWorkflowsClient); ok { r0 = rf(ctx, in, opts...) } else { @@ -489,7 +538,6 @@ func (_m *WorkflowServiceClient) WatchWorkflows(ctx context.Context, in *workflo } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WatchWorkflowsRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -511,6 +559,10 @@ func (_m *WorkflowServiceClient) WorkflowLogs(ctx context.Context, in *workflow. ret := _m.Called(_ca...) var r0 workflow.WorkflowService_WorkflowLogsClient + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowLogRequest, ...grpc.CallOption) (workflow.WorkflowService_WorkflowLogsClient, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflow.WorkflowLogRequest, ...grpc.CallOption) workflow.WorkflowService_WorkflowLogsClient); ok { r0 = rf(ctx, in, opts...) } else { @@ -519,7 +571,6 @@ func (_m *WorkflowServiceClient) WorkflowLogs(ctx context.Context, in *workflow. } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflow.WorkflowLogRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -528,3 +579,18 @@ func (_m *WorkflowServiceClient) WorkflowLogs(ctx context.Context, in *workflow. return r0, r1 } + +type mockConstructorTestingTNewWorkflowServiceClient interface { + mock.TestingT + Cleanup(func()) +} + +// NewWorkflowServiceClient creates a new instance of WorkflowServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewWorkflowServiceClient(t mockConstructorTestingTNewWorkflowServiceClient) *WorkflowServiceClient { + mock := &WorkflowServiceClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/apiclient/workflowtemplate/mocks/WorkflowTemplateServiceClient.go b/pkg/apiclient/workflowtemplate/mocks/WorkflowTemplateServiceClient.go index 9be32335d0a5..1e5a68880d64 100644 --- a/pkg/apiclient/workflowtemplate/mocks/WorkflowTemplateServiceClient.go +++ b/pkg/apiclient/workflowtemplate/mocks/WorkflowTemplateServiceClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.0. DO NOT EDIT. +// Code generated by mockery v2.26.0. DO NOT EDIT. package mocks @@ -31,6 +31,10 @@ func (_m *WorkflowTemplateServiceClient) CreateWorkflowTemplate(ctx context.Cont ret := _m.Called(_ca...) var r0 *v1alpha1.WorkflowTemplate + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflowtemplate.WorkflowTemplateCreateRequest, ...grpc.CallOption) (*v1alpha1.WorkflowTemplate, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflowtemplate.WorkflowTemplateCreateRequest, ...grpc.CallOption) *v1alpha1.WorkflowTemplate); ok { r0 = rf(ctx, in, opts...) } else { @@ -39,7 +43,6 @@ func (_m *WorkflowTemplateServiceClient) CreateWorkflowTemplate(ctx context.Cont } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflowtemplate.WorkflowTemplateCreateRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -61,6 +64,10 @@ func (_m *WorkflowTemplateServiceClient) DeleteWorkflowTemplate(ctx context.Cont ret := _m.Called(_ca...) var r0 *workflowtemplate.WorkflowTemplateDeleteResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflowtemplate.WorkflowTemplateDeleteRequest, ...grpc.CallOption) (*workflowtemplate.WorkflowTemplateDeleteResponse, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflowtemplate.WorkflowTemplateDeleteRequest, ...grpc.CallOption) *workflowtemplate.WorkflowTemplateDeleteResponse); ok { r0 = rf(ctx, in, opts...) } else { @@ -69,7 +76,6 @@ func (_m *WorkflowTemplateServiceClient) DeleteWorkflowTemplate(ctx context.Cont } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflowtemplate.WorkflowTemplateDeleteRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -91,6 +97,10 @@ func (_m *WorkflowTemplateServiceClient) GetWorkflowTemplate(ctx context.Context ret := _m.Called(_ca...) var r0 *v1alpha1.WorkflowTemplate + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflowtemplate.WorkflowTemplateGetRequest, ...grpc.CallOption) (*v1alpha1.WorkflowTemplate, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflowtemplate.WorkflowTemplateGetRequest, ...grpc.CallOption) *v1alpha1.WorkflowTemplate); ok { r0 = rf(ctx, in, opts...) } else { @@ -99,7 +109,6 @@ func (_m *WorkflowTemplateServiceClient) GetWorkflowTemplate(ctx context.Context } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflowtemplate.WorkflowTemplateGetRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -121,6 +130,10 @@ func (_m *WorkflowTemplateServiceClient) LintWorkflowTemplate(ctx context.Contex ret := _m.Called(_ca...) var r0 *v1alpha1.WorkflowTemplate + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflowtemplate.WorkflowTemplateLintRequest, ...grpc.CallOption) (*v1alpha1.WorkflowTemplate, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflowtemplate.WorkflowTemplateLintRequest, ...grpc.CallOption) *v1alpha1.WorkflowTemplate); ok { r0 = rf(ctx, in, opts...) } else { @@ -129,7 +142,6 @@ func (_m *WorkflowTemplateServiceClient) LintWorkflowTemplate(ctx context.Contex } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflowtemplate.WorkflowTemplateLintRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -151,6 +163,10 @@ func (_m *WorkflowTemplateServiceClient) ListWorkflowTemplates(ctx context.Conte ret := _m.Called(_ca...) var r0 *v1alpha1.WorkflowTemplateList + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflowtemplate.WorkflowTemplateListRequest, ...grpc.CallOption) (*v1alpha1.WorkflowTemplateList, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflowtemplate.WorkflowTemplateListRequest, ...grpc.CallOption) *v1alpha1.WorkflowTemplateList); ok { r0 = rf(ctx, in, opts...) } else { @@ -159,7 +175,6 @@ func (_m *WorkflowTemplateServiceClient) ListWorkflowTemplates(ctx context.Conte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflowtemplate.WorkflowTemplateListRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -181,6 +196,10 @@ func (_m *WorkflowTemplateServiceClient) UpdateWorkflowTemplate(ctx context.Cont ret := _m.Called(_ca...) var r0 *v1alpha1.WorkflowTemplate + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *workflowtemplate.WorkflowTemplateUpdateRequest, ...grpc.CallOption) (*v1alpha1.WorkflowTemplate, error)); ok { + return rf(ctx, in, opts...) + } if rf, ok := ret.Get(0).(func(context.Context, *workflowtemplate.WorkflowTemplateUpdateRequest, ...grpc.CallOption) *v1alpha1.WorkflowTemplate); ok { r0 = rf(ctx, in, opts...) } else { @@ -189,7 +208,6 @@ func (_m *WorkflowTemplateServiceClient) UpdateWorkflowTemplate(ctx context.Cont } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *workflowtemplate.WorkflowTemplateUpdateRequest, ...grpc.CallOption) error); ok { r1 = rf(ctx, in, opts...) } else { @@ -198,3 +216,18 @@ func (_m *WorkflowTemplateServiceClient) UpdateWorkflowTemplate(ctx context.Cont return r0, r1 } + +type mockConstructorTestingTNewWorkflowTemplateServiceClient interface { + mock.TestingT + Cleanup(func()) +} + +// NewWorkflowTemplateServiceClient creates a new instance of WorkflowTemplateServiceClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewWorkflowTemplateServiceClient(t mockConstructorTestingTNewWorkflowTemplateServiceClient) *WorkflowTemplateServiceClient { + mock := &WorkflowTemplateServiceClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/auth/mocks/Gatekeeper.go b/server/auth/mocks/Gatekeeper.go index f4a570579ab3..f9cbf136761f 100644 --- a/server/auth/mocks/Gatekeeper.go +++ b/server/auth/mocks/Gatekeeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.0. DO NOT EDIT. +// Code generated by mockery v2.26.0. DO NOT EDIT. package mocks @@ -20,6 +20,10 @@ func (_m *Gatekeeper) Context(ctx context.Context) (context.Context, error) { ret := _m.Called(ctx) var r0 context.Context + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (context.Context, error)); ok { + return rf(ctx) + } if rf, ok := ret.Get(0).(func(context.Context) context.Context); ok { r0 = rf(ctx) } else { @@ -28,7 +32,6 @@ func (_m *Gatekeeper) Context(ctx context.Context) (context.Context, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { @@ -43,6 +46,10 @@ func (_m *Gatekeeper) ContextWithRequest(ctx context.Context, req interface{}) ( ret := _m.Called(ctx, req) var r0 context.Context + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, interface{}) (context.Context, error)); ok { + return rf(ctx, req) + } if rf, ok := ret.Get(0).(func(context.Context, interface{}) context.Context); ok { r0 = rf(ctx, req) } else { @@ -51,7 +58,6 @@ func (_m *Gatekeeper) ContextWithRequest(ctx context.Context, req interface{}) ( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, interface{}) error); ok { r1 = rf(ctx, req) } else { @@ -92,3 +98,18 @@ func (_m *Gatekeeper) UnaryServerInterceptor() grpc.UnaryServerInterceptor { return r0 } + +type mockConstructorTestingTNewGatekeeper interface { + mock.TestingT + Cleanup(func()) +} + +// NewGatekeeper creates a new instance of Gatekeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewGatekeeper(t mockConstructorTestingTNewGatekeeper) *Gatekeeper { + mock := &Gatekeeper{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/server/auth/sso/mocks/Interface.go b/server/auth/sso/mocks/Interface.go index a2ab5d3eb9c1..205f8fd6d5d2 100644 --- a/server/auth/sso/mocks/Interface.go +++ b/server/auth/sso/mocks/Interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.0. DO NOT EDIT. +// Code generated by mockery v2.26.0. DO NOT EDIT. package mocks @@ -20,6 +20,10 @@ func (_m *Interface) Authorize(authorization string) (*types.Claims, error) { ret := _m.Called(authorization) var r0 *types.Claims + var r1 error + if rf, ok := ret.Get(0).(func(string) (*types.Claims, error)); ok { + return rf(authorization) + } if rf, ok := ret.Get(0).(func(string) *types.Claims); ok { r0 = rf(authorization) } else { @@ -28,7 +32,6 @@ func (_m *Interface) Authorize(authorization string) (*types.Claims, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(authorization) } else { @@ -61,3 +64,18 @@ func (_m *Interface) IsRBACEnabled() bool { return r0 } + +type mockConstructorTestingTNewInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewInterface creates a new instance of Interface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewInterface(t mockConstructorTestingTNewInterface) *Interface { + mock := &Interface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/workflow/artifactrepositories/mocks/Interface.go b/workflow/artifactrepositories/mocks/Interface.go index 46b7e3b3ccfb..c392ce6eb540 100644 --- a/workflow/artifactrepositories/mocks/Interface.go +++ b/workflow/artifactrepositories/mocks/Interface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.0. DO NOT EDIT. +// Code generated by mockery v2.26.0. DO NOT EDIT. package mocks @@ -19,6 +19,10 @@ func (_m *Interface) Get(ctx context.Context, ref *v1alpha1.ArtifactRepositoryRe ret := _m.Called(ctx, ref) var r0 *v1alpha1.ArtifactRepository + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1alpha1.ArtifactRepositoryRefStatus) (*v1alpha1.ArtifactRepository, error)); ok { + return rf(ctx, ref) + } if rf, ok := ret.Get(0).(func(context.Context, *v1alpha1.ArtifactRepositoryRefStatus) *v1alpha1.ArtifactRepository); ok { r0 = rf(ctx, ref) } else { @@ -27,7 +31,6 @@ func (_m *Interface) Get(ctx context.Context, ref *v1alpha1.ArtifactRepositoryRe } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *v1alpha1.ArtifactRepositoryRefStatus) error); ok { r1 = rf(ctx, ref) } else { @@ -42,6 +45,10 @@ func (_m *Interface) Resolve(ctx context.Context, ref *v1alpha1.ArtifactReposito ret := _m.Called(ctx, ref, workflowNamespace) var r0 *v1alpha1.ArtifactRepositoryRefStatus + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *v1alpha1.ArtifactRepositoryRef, string) (*v1alpha1.ArtifactRepositoryRefStatus, error)); ok { + return rf(ctx, ref, workflowNamespace) + } if rf, ok := ret.Get(0).(func(context.Context, *v1alpha1.ArtifactRepositoryRef, string) *v1alpha1.ArtifactRepositoryRefStatus); ok { r0 = rf(ctx, ref, workflowNamespace) } else { @@ -50,7 +57,6 @@ func (_m *Interface) Resolve(ctx context.Context, ref *v1alpha1.ArtifactReposito } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *v1alpha1.ArtifactRepositoryRef, string) error); ok { r1 = rf(ctx, ref, workflowNamespace) } else { @@ -59,3 +65,18 @@ func (_m *Interface) Resolve(ctx context.Context, ref *v1alpha1.ArtifactReposito return r0, r1 } + +type mockConstructorTestingTNewInterface interface { + mock.TestingT + Cleanup(func()) +} + +// NewInterface creates a new instance of Interface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewInterface(t mockConstructorTestingTNewInterface) *Interface { + mock := &Interface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/workflow/executor/mocks/ContainerRuntimeExecutor.go b/workflow/executor/mocks/ContainerRuntimeExecutor.go index cad85824d452..6eb7026e866c 100644 --- a/workflow/executor/mocks/ContainerRuntimeExecutor.go +++ b/workflow/executor/mocks/ContainerRuntimeExecutor.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.0. DO NOT EDIT. +// Code generated by mockery v2.26.0. DO NOT EDIT. package mocks @@ -36,13 +36,16 @@ func (_m *ContainerRuntimeExecutor) GetFileContents(containerName string, source ret := _m.Called(containerName, sourcePath) var r0 string + var r1 error + if rf, ok := ret.Get(0).(func(string, string) (string, error)); ok { + return rf(containerName, sourcePath) + } if rf, ok := ret.Get(0).(func(string, string) string); ok { r0 = rf(containerName, sourcePath) } else { r0 = ret.Get(0).(string) } - var r1 error if rf, ok := ret.Get(1).(func(string, string) error); ok { r1 = rf(containerName, sourcePath) } else { @@ -57,6 +60,10 @@ func (_m *ContainerRuntimeExecutor) GetOutputStream(ctx context.Context, contain ret := _m.Called(ctx, containerName, combinedOutput) var r0 io.ReadCloser + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bool) (io.ReadCloser, error)); ok { + return rf(ctx, containerName, combinedOutput) + } if rf, ok := ret.Get(0).(func(context.Context, string, bool) io.ReadCloser); ok { r0 = rf(ctx, containerName, combinedOutput) } else { @@ -65,7 +72,6 @@ func (_m *ContainerRuntimeExecutor) GetOutputStream(ctx context.Context, contain } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bool) error); ok { r1 = rf(ctx, containerName, combinedOutput) } else { @@ -102,3 +108,18 @@ func (_m *ContainerRuntimeExecutor) Wait(ctx context.Context, containerNames []s return r0 } + +type mockConstructorTestingTNewContainerRuntimeExecutor interface { + mock.TestingT + Cleanup(func()) +} + +// NewContainerRuntimeExecutor creates a new instance of ContainerRuntimeExecutor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewContainerRuntimeExecutor(t mockConstructorTestingTNewContainerRuntimeExecutor) *ContainerRuntimeExecutor { + mock := &ContainerRuntimeExecutor{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/workflow/sync/mocks/Throttler.go b/workflow/sync/mocks/Throttler.go index d42945e3cb34..61399ac62720 100644 --- a/workflow/sync/mocks/Throttler.go +++ b/workflow/sync/mocks/Throttler.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.0. DO NOT EDIT. +// Code generated by mockery v2.26.0. DO NOT EDIT. package mocks @@ -52,3 +52,18 @@ func (_m *Throttler) Init(wfs []v1alpha1.Workflow) error { func (_m *Throttler) Remove(key string) { _m.Called(key) } + +type mockConstructorTestingTNewThrottler interface { + mock.TestingT + Cleanup(func()) +} + +// NewThrottler creates a new instance of Throttler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewThrottler(t mockConstructorTestingTNewThrottler) *Throttler { + mock := &Throttler{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}