From 220d59468fad54d9a36363a77fde398ae23ac20c Mon Sep 17 00:00:00 2001 From: Dan Rammer Date: Tue, 16 Jul 2024 11:48:48 -0500 Subject: [PATCH] reverted mockery-v2 on ExecutionContext (#5562) Signed-off-by: Daniel Rammer --- .../controller/executors/execution_context.go | 2 +- .../executors/mocks/control_flow.go | 128 +++ .../executors/mocks/execution_context.go | 878 +++++------------- .../mocks/immutable_execution_context.go | 32 + .../controller/nodes/array/handler_test.go | 26 +- .../controller/nodes/branch/handler_test.go | 8 +- .../pkg/controller/nodes/cache_test.go | 4 +- .../nodes/dynamic/dynamic_workflow_test.go | 26 +- .../controller/nodes/dynamic/handler_test.go | 16 +- .../pkg/controller/nodes/executor_test.go | 46 +- .../pkg/controller/nodes/gate/handler_test.go | 2 +- .../nodes/subworkflow/handler_test.go | 32 +- .../nodes/subworkflow/launchplan_test.go | 20 +- .../nodes/subworkflow/subworkflow_test.go | 16 +- .../pkg/controller/nodes/task/handler_test.go | 26 +- .../nodes/task/taskexec_context_test.go | 6 +- .../controller/nodes/task/transformer_test.go | 8 +- 17 files changed, 529 insertions(+), 747 deletions(-) diff --git a/flytepropeller/pkg/controller/executors/execution_context.go b/flytepropeller/pkg/controller/executors/execution_context.go index b693d1aee8..ebb95c0ef7 100644 --- a/flytepropeller/pkg/controller/executors/execution_context.go +++ b/flytepropeller/pkg/controller/executors/execution_context.go @@ -4,7 +4,7 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/apis/flyteworkflow/v1alpha1" ) -//go:generate mockery-v2 --case=underscore --with-expecter --name ExecutionContext --output=mocks +//go:generate mockery -all -case=underscore type TaskDetailsGetter interface { GetTask(id v1alpha1.TaskID) (v1alpha1.ExecutableTask, error) diff --git a/flytepropeller/pkg/controller/executors/mocks/control_flow.go b/flytepropeller/pkg/controller/executors/mocks/control_flow.go index f5366e1580..04feeca4b0 100644 --- a/flytepropeller/pkg/controller/executors/mocks/control_flow.go +++ b/flytepropeller/pkg/controller/executors/mocks/control_flow.go @@ -9,6 +9,38 @@ type ControlFlow struct { mock.Mock } +type ControlFlow_CurrentNodeExecutionCount struct { + *mock.Call +} + +func (_m ControlFlow_CurrentNodeExecutionCount) Return(_a0 uint32) *ControlFlow_CurrentNodeExecutionCount { + return &ControlFlow_CurrentNodeExecutionCount{Call: _m.Call.Return(_a0)} +} + +func (_m *ControlFlow) OnCurrentNodeExecutionCount() *ControlFlow_CurrentNodeExecutionCount { + c_call := _m.On("CurrentNodeExecutionCount") + return &ControlFlow_CurrentNodeExecutionCount{Call: c_call} +} + +func (_m *ControlFlow) OnCurrentNodeExecutionCountMatch(matchers ...interface{}) *ControlFlow_CurrentNodeExecutionCount { + c_call := _m.On("CurrentNodeExecutionCount", matchers...) + return &ControlFlow_CurrentNodeExecutionCount{Call: c_call} +} + +// CurrentNodeExecutionCount provides a mock function with given fields: +func (_m *ControlFlow) CurrentNodeExecutionCount() uint32 { + ret := _m.Called() + + var r0 uint32 + if rf, ok := ret.Get(0).(func() uint32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint32) + } + + return r0 +} + type ControlFlow_CurrentParallelism struct { *mock.Call } @@ -41,6 +73,70 @@ func (_m *ControlFlow) CurrentParallelism() uint32 { return r0 } +type ControlFlow_CurrentTaskExecutionCount struct { + *mock.Call +} + +func (_m ControlFlow_CurrentTaskExecutionCount) Return(_a0 uint32) *ControlFlow_CurrentTaskExecutionCount { + return &ControlFlow_CurrentTaskExecutionCount{Call: _m.Call.Return(_a0)} +} + +func (_m *ControlFlow) OnCurrentTaskExecutionCount() *ControlFlow_CurrentTaskExecutionCount { + c_call := _m.On("CurrentTaskExecutionCount") + return &ControlFlow_CurrentTaskExecutionCount{Call: c_call} +} + +func (_m *ControlFlow) OnCurrentTaskExecutionCountMatch(matchers ...interface{}) *ControlFlow_CurrentTaskExecutionCount { + c_call := _m.On("CurrentTaskExecutionCount", matchers...) + return &ControlFlow_CurrentTaskExecutionCount{Call: c_call} +} + +// CurrentTaskExecutionCount provides a mock function with given fields: +func (_m *ControlFlow) CurrentTaskExecutionCount() uint32 { + ret := _m.Called() + + var r0 uint32 + if rf, ok := ret.Get(0).(func() uint32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint32) + } + + return r0 +} + +type ControlFlow_IncrementNodeExecutionCount struct { + *mock.Call +} + +func (_m ControlFlow_IncrementNodeExecutionCount) Return(_a0 uint32) *ControlFlow_IncrementNodeExecutionCount { + return &ControlFlow_IncrementNodeExecutionCount{Call: _m.Call.Return(_a0)} +} + +func (_m *ControlFlow) OnIncrementNodeExecutionCount() *ControlFlow_IncrementNodeExecutionCount { + c_call := _m.On("IncrementNodeExecutionCount") + return &ControlFlow_IncrementNodeExecutionCount{Call: c_call} +} + +func (_m *ControlFlow) OnIncrementNodeExecutionCountMatch(matchers ...interface{}) *ControlFlow_IncrementNodeExecutionCount { + c_call := _m.On("IncrementNodeExecutionCount", matchers...) + return &ControlFlow_IncrementNodeExecutionCount{Call: c_call} +} + +// IncrementNodeExecutionCount provides a mock function with given fields: +func (_m *ControlFlow) IncrementNodeExecutionCount() uint32 { + ret := _m.Called() + + var r0 uint32 + if rf, ok := ret.Get(0).(func() uint32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint32) + } + + return r0 +} + type ControlFlow_IncrementParallelism struct { *mock.Call } @@ -72,3 +168,35 @@ func (_m *ControlFlow) IncrementParallelism() uint32 { return r0 } + +type ControlFlow_IncrementTaskExecutionCount struct { + *mock.Call +} + +func (_m ControlFlow_IncrementTaskExecutionCount) Return(_a0 uint32) *ControlFlow_IncrementTaskExecutionCount { + return &ControlFlow_IncrementTaskExecutionCount{Call: _m.Call.Return(_a0)} +} + +func (_m *ControlFlow) OnIncrementTaskExecutionCount() *ControlFlow_IncrementTaskExecutionCount { + c_call := _m.On("IncrementTaskExecutionCount") + return &ControlFlow_IncrementTaskExecutionCount{Call: c_call} +} + +func (_m *ControlFlow) OnIncrementTaskExecutionCountMatch(matchers ...interface{}) *ControlFlow_IncrementTaskExecutionCount { + c_call := _m.On("IncrementTaskExecutionCount", matchers...) + return &ControlFlow_IncrementTaskExecutionCount{Call: c_call} +} + +// IncrementTaskExecutionCount provides a mock function with given fields: +func (_m *ControlFlow) IncrementTaskExecutionCount() uint32 { + ret := _m.Called() + + var r0 uint32 + if rf, ok := ret.Get(0).(func() uint32); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(uint32) + } + + return r0 +} diff --git a/flytepropeller/pkg/controller/executors/mocks/execution_context.go b/flytepropeller/pkg/controller/executors/mocks/execution_context.go index cbcd501525..9f4f646cf2 100644 --- a/flytepropeller/pkg/controller/executors/mocks/execution_context.go +++ b/flytepropeller/pkg/controller/executors/mocks/execution_context.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.40.3. DO NOT EDIT. +// Code generated by mockery v1.0.1. DO NOT EDIT. package mocks @@ -20,22 +20,28 @@ type ExecutionContext struct { mock.Mock } -type ExecutionContext_Expecter struct { - mock *mock.Mock +type ExecutionContext_CurrentNodeExecutionCount struct { + *mock.Call +} + +func (_m ExecutionContext_CurrentNodeExecutionCount) Return(_a0 uint32) *ExecutionContext_CurrentNodeExecutionCount { + return &ExecutionContext_CurrentNodeExecutionCount{Call: _m.Call.Return(_a0)} +} + +func (_m *ExecutionContext) OnCurrentNodeExecutionCount() *ExecutionContext_CurrentNodeExecutionCount { + c_call := _m.On("CurrentNodeExecutionCount") + return &ExecutionContext_CurrentNodeExecutionCount{Call: c_call} } -func (_m *ExecutionContext) EXPECT() *ExecutionContext_Expecter { - return &ExecutionContext_Expecter{mock: &_m.Mock} +func (_m *ExecutionContext) OnCurrentNodeExecutionCountMatch(matchers ...interface{}) *ExecutionContext_CurrentNodeExecutionCount { + c_call := _m.On("CurrentNodeExecutionCount", matchers...) + return &ExecutionContext_CurrentNodeExecutionCount{Call: c_call} } // CurrentNodeExecutionCount provides a mock function with given fields: func (_m *ExecutionContext) CurrentNodeExecutionCount() uint32 { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for CurrentNodeExecutionCount") - } - var r0 uint32 if rf, ok := ret.Get(0).(func() uint32); ok { r0 = rf() @@ -46,41 +52,28 @@ func (_m *ExecutionContext) CurrentNodeExecutionCount() uint32 { return r0 } -// ExecutionContext_CurrentNodeExecutionCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CurrentNodeExecutionCount' -type ExecutionContext_CurrentNodeExecutionCount_Call struct { +type ExecutionContext_CurrentParallelism struct { *mock.Call } -// CurrentNodeExecutionCount is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) CurrentNodeExecutionCount() *ExecutionContext_CurrentNodeExecutionCount_Call { - return &ExecutionContext_CurrentNodeExecutionCount_Call{Call: _e.mock.On("CurrentNodeExecutionCount")} -} - -func (_c *ExecutionContext_CurrentNodeExecutionCount_Call) Run(run func()) *ExecutionContext_CurrentNodeExecutionCount_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_CurrentParallelism) Return(_a0 uint32) *ExecutionContext_CurrentParallelism { + return &ExecutionContext_CurrentParallelism{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_CurrentNodeExecutionCount_Call) Return(_a0 uint32) *ExecutionContext_CurrentNodeExecutionCount_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnCurrentParallelism() *ExecutionContext_CurrentParallelism { + c_call := _m.On("CurrentParallelism") + return &ExecutionContext_CurrentParallelism{Call: c_call} } -func (_c *ExecutionContext_CurrentNodeExecutionCount_Call) RunAndReturn(run func() uint32) *ExecutionContext_CurrentNodeExecutionCount_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnCurrentParallelismMatch(matchers ...interface{}) *ExecutionContext_CurrentParallelism { + c_call := _m.On("CurrentParallelism", matchers...) + return &ExecutionContext_CurrentParallelism{Call: c_call} } // CurrentParallelism provides a mock function with given fields: func (_m *ExecutionContext) CurrentParallelism() uint32 { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for CurrentParallelism") - } - var r0 uint32 if rf, ok := ret.Get(0).(func() uint32); ok { r0 = rf() @@ -91,41 +84,28 @@ func (_m *ExecutionContext) CurrentParallelism() uint32 { return r0 } -// ExecutionContext_CurrentParallelism_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CurrentParallelism' -type ExecutionContext_CurrentParallelism_Call struct { +type ExecutionContext_CurrentTaskExecutionCount struct { *mock.Call } -// CurrentParallelism is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) CurrentParallelism() *ExecutionContext_CurrentParallelism_Call { - return &ExecutionContext_CurrentParallelism_Call{Call: _e.mock.On("CurrentParallelism")} -} - -func (_c *ExecutionContext_CurrentParallelism_Call) Run(run func()) *ExecutionContext_CurrentParallelism_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_CurrentTaskExecutionCount) Return(_a0 uint32) *ExecutionContext_CurrentTaskExecutionCount { + return &ExecutionContext_CurrentTaskExecutionCount{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_CurrentParallelism_Call) Return(_a0 uint32) *ExecutionContext_CurrentParallelism_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnCurrentTaskExecutionCount() *ExecutionContext_CurrentTaskExecutionCount { + c_call := _m.On("CurrentTaskExecutionCount") + return &ExecutionContext_CurrentTaskExecutionCount{Call: c_call} } -func (_c *ExecutionContext_CurrentParallelism_Call) RunAndReturn(run func() uint32) *ExecutionContext_CurrentParallelism_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnCurrentTaskExecutionCountMatch(matchers ...interface{}) *ExecutionContext_CurrentTaskExecutionCount { + c_call := _m.On("CurrentTaskExecutionCount", matchers...) + return &ExecutionContext_CurrentTaskExecutionCount{Call: c_call} } // CurrentTaskExecutionCount provides a mock function with given fields: func (_m *ExecutionContext) CurrentTaskExecutionCount() uint32 { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for CurrentTaskExecutionCount") - } - var r0 uint32 if rf, ok := ret.Get(0).(func() uint32); ok { r0 = rf() @@ -136,41 +116,28 @@ func (_m *ExecutionContext) CurrentTaskExecutionCount() uint32 { return r0 } -// ExecutionContext_CurrentTaskExecutionCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CurrentTaskExecutionCount' -type ExecutionContext_CurrentTaskExecutionCount_Call struct { +type ExecutionContext_FindSubWorkflow struct { *mock.Call } -// CurrentTaskExecutionCount is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) CurrentTaskExecutionCount() *ExecutionContext_CurrentTaskExecutionCount_Call { - return &ExecutionContext_CurrentTaskExecutionCount_Call{Call: _e.mock.On("CurrentTaskExecutionCount")} -} - -func (_c *ExecutionContext_CurrentTaskExecutionCount_Call) Run(run func()) *ExecutionContext_CurrentTaskExecutionCount_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_FindSubWorkflow) Return(_a0 v1alpha1.ExecutableSubWorkflow) *ExecutionContext_FindSubWorkflow { + return &ExecutionContext_FindSubWorkflow{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_CurrentTaskExecutionCount_Call) Return(_a0 uint32) *ExecutionContext_CurrentTaskExecutionCount_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnFindSubWorkflow(subID string) *ExecutionContext_FindSubWorkflow { + c_call := _m.On("FindSubWorkflow", subID) + return &ExecutionContext_FindSubWorkflow{Call: c_call} } -func (_c *ExecutionContext_CurrentTaskExecutionCount_Call) RunAndReturn(run func() uint32) *ExecutionContext_CurrentTaskExecutionCount_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnFindSubWorkflowMatch(matchers ...interface{}) *ExecutionContext_FindSubWorkflow { + c_call := _m.On("FindSubWorkflow", matchers...) + return &ExecutionContext_FindSubWorkflow{Call: c_call} } // FindSubWorkflow provides a mock function with given fields: subID func (_m *ExecutionContext) FindSubWorkflow(subID string) v1alpha1.ExecutableSubWorkflow { ret := _m.Called(subID) - if len(ret) == 0 { - panic("no return value specified for FindSubWorkflow") - } - var r0 v1alpha1.ExecutableSubWorkflow if rf, ok := ret.Get(0).(func(string) v1alpha1.ExecutableSubWorkflow); ok { r0 = rf(subID) @@ -183,42 +150,28 @@ func (_m *ExecutionContext) FindSubWorkflow(subID string) v1alpha1.ExecutableSub return r0 } -// ExecutionContext_FindSubWorkflow_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindSubWorkflow' -type ExecutionContext_FindSubWorkflow_Call struct { +type ExecutionContext_GetAnnotations struct { *mock.Call } -// FindSubWorkflow is a helper method to define mock.On call -// - subID string -func (_e *ExecutionContext_Expecter) FindSubWorkflow(subID interface{}) *ExecutionContext_FindSubWorkflow_Call { - return &ExecutionContext_FindSubWorkflow_Call{Call: _e.mock.On("FindSubWorkflow", subID)} -} - -func (_c *ExecutionContext_FindSubWorkflow_Call) Run(run func(subID string)) *ExecutionContext_FindSubWorkflow_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c +func (_m ExecutionContext_GetAnnotations) Return(_a0 map[string]string) *ExecutionContext_GetAnnotations { + return &ExecutionContext_GetAnnotations{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_FindSubWorkflow_Call) Return(_a0 v1alpha1.ExecutableSubWorkflow) *ExecutionContext_FindSubWorkflow_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetAnnotations() *ExecutionContext_GetAnnotations { + c_call := _m.On("GetAnnotations") + return &ExecutionContext_GetAnnotations{Call: c_call} } -func (_c *ExecutionContext_FindSubWorkflow_Call) RunAndReturn(run func(string) v1alpha1.ExecutableSubWorkflow) *ExecutionContext_FindSubWorkflow_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetAnnotationsMatch(matchers ...interface{}) *ExecutionContext_GetAnnotations { + c_call := _m.On("GetAnnotations", matchers...) + return &ExecutionContext_GetAnnotations{Call: c_call} } // GetAnnotations provides a mock function with given fields: func (_m *ExecutionContext) GetAnnotations() map[string]string { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetAnnotations") - } - var r0 map[string]string if rf, ok := ret.Get(0).(func() map[string]string); ok { r0 = rf() @@ -231,41 +184,28 @@ func (_m *ExecutionContext) GetAnnotations() map[string]string { return r0 } -// ExecutionContext_GetAnnotations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAnnotations' -type ExecutionContext_GetAnnotations_Call struct { +type ExecutionContext_GetConsoleURL struct { *mock.Call } -// GetAnnotations is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetAnnotations() *ExecutionContext_GetAnnotations_Call { - return &ExecutionContext_GetAnnotations_Call{Call: _e.mock.On("GetAnnotations")} -} - -func (_c *ExecutionContext_GetAnnotations_Call) Run(run func()) *ExecutionContext_GetAnnotations_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetConsoleURL) Return(_a0 string) *ExecutionContext_GetConsoleURL { + return &ExecutionContext_GetConsoleURL{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetAnnotations_Call) Return(_a0 map[string]string) *ExecutionContext_GetAnnotations_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetConsoleURL() *ExecutionContext_GetConsoleURL { + c_call := _m.On("GetConsoleURL") + return &ExecutionContext_GetConsoleURL{Call: c_call} } -func (_c *ExecutionContext_GetAnnotations_Call) RunAndReturn(run func() map[string]string) *ExecutionContext_GetAnnotations_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetConsoleURLMatch(matchers ...interface{}) *ExecutionContext_GetConsoleURL { + c_call := _m.On("GetConsoleURL", matchers...) + return &ExecutionContext_GetConsoleURL{Call: c_call} } // GetConsoleURL provides a mock function with given fields: func (_m *ExecutionContext) GetConsoleURL() string { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetConsoleURL") - } - var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -276,41 +216,28 @@ func (_m *ExecutionContext) GetConsoleURL() string { return r0 } -// ExecutionContext_GetConsoleURL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConsoleURL' -type ExecutionContext_GetConsoleURL_Call struct { +type ExecutionContext_GetCreationTimestamp struct { *mock.Call } -// GetConsoleURL is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetConsoleURL() *ExecutionContext_GetConsoleURL_Call { - return &ExecutionContext_GetConsoleURL_Call{Call: _e.mock.On("GetConsoleURL")} -} - -func (_c *ExecutionContext_GetConsoleURL_Call) Run(run func()) *ExecutionContext_GetConsoleURL_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetCreationTimestamp) Return(_a0 v1.Time) *ExecutionContext_GetCreationTimestamp { + return &ExecutionContext_GetCreationTimestamp{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetConsoleURL_Call) Return(_a0 string) *ExecutionContext_GetConsoleURL_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetCreationTimestamp() *ExecutionContext_GetCreationTimestamp { + c_call := _m.On("GetCreationTimestamp") + return &ExecutionContext_GetCreationTimestamp{Call: c_call} } -func (_c *ExecutionContext_GetConsoleURL_Call) RunAndReturn(run func() string) *ExecutionContext_GetConsoleURL_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetCreationTimestampMatch(matchers ...interface{}) *ExecutionContext_GetCreationTimestamp { + c_call := _m.On("GetCreationTimestamp", matchers...) + return &ExecutionContext_GetCreationTimestamp{Call: c_call} } // GetCreationTimestamp provides a mock function with given fields: func (_m *ExecutionContext) GetCreationTimestamp() v1.Time { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetCreationTimestamp") - } - var r0 v1.Time if rf, ok := ret.Get(0).(func() v1.Time); ok { r0 = rf() @@ -321,41 +248,28 @@ func (_m *ExecutionContext) GetCreationTimestamp() v1.Time { return r0 } -// ExecutionContext_GetCreationTimestamp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCreationTimestamp' -type ExecutionContext_GetCreationTimestamp_Call struct { +type ExecutionContext_GetDefinitionVersion struct { *mock.Call } -// GetCreationTimestamp is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetCreationTimestamp() *ExecutionContext_GetCreationTimestamp_Call { - return &ExecutionContext_GetCreationTimestamp_Call{Call: _e.mock.On("GetCreationTimestamp")} -} - -func (_c *ExecutionContext_GetCreationTimestamp_Call) Run(run func()) *ExecutionContext_GetCreationTimestamp_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetDefinitionVersion) Return(_a0 v1alpha1.WorkflowDefinitionVersion) *ExecutionContext_GetDefinitionVersion { + return &ExecutionContext_GetDefinitionVersion{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetCreationTimestamp_Call) Return(_a0 v1.Time) *ExecutionContext_GetCreationTimestamp_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetDefinitionVersion() *ExecutionContext_GetDefinitionVersion { + c_call := _m.On("GetDefinitionVersion") + return &ExecutionContext_GetDefinitionVersion{Call: c_call} } -func (_c *ExecutionContext_GetCreationTimestamp_Call) RunAndReturn(run func() v1.Time) *ExecutionContext_GetCreationTimestamp_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetDefinitionVersionMatch(matchers ...interface{}) *ExecutionContext_GetDefinitionVersion { + c_call := _m.On("GetDefinitionVersion", matchers...) + return &ExecutionContext_GetDefinitionVersion{Call: c_call} } // GetDefinitionVersion provides a mock function with given fields: func (_m *ExecutionContext) GetDefinitionVersion() v1alpha1.WorkflowDefinitionVersion { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetDefinitionVersion") - } - var r0 v1alpha1.WorkflowDefinitionVersion if rf, ok := ret.Get(0).(func() v1alpha1.WorkflowDefinitionVersion); ok { r0 = rf() @@ -366,41 +280,28 @@ func (_m *ExecutionContext) GetDefinitionVersion() v1alpha1.WorkflowDefinitionVe return r0 } -// ExecutionContext_GetDefinitionVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDefinitionVersion' -type ExecutionContext_GetDefinitionVersion_Call struct { +type ExecutionContext_GetEventVersion struct { *mock.Call } -// GetDefinitionVersion is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetDefinitionVersion() *ExecutionContext_GetDefinitionVersion_Call { - return &ExecutionContext_GetDefinitionVersion_Call{Call: _e.mock.On("GetDefinitionVersion")} -} - -func (_c *ExecutionContext_GetDefinitionVersion_Call) Run(run func()) *ExecutionContext_GetDefinitionVersion_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetEventVersion) Return(_a0 v1alpha1.EventVersion) *ExecutionContext_GetEventVersion { + return &ExecutionContext_GetEventVersion{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetDefinitionVersion_Call) Return(_a0 v1alpha1.WorkflowDefinitionVersion) *ExecutionContext_GetDefinitionVersion_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetEventVersion() *ExecutionContext_GetEventVersion { + c_call := _m.On("GetEventVersion") + return &ExecutionContext_GetEventVersion{Call: c_call} } -func (_c *ExecutionContext_GetDefinitionVersion_Call) RunAndReturn(run func() v1alpha1.WorkflowDefinitionVersion) *ExecutionContext_GetDefinitionVersion_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetEventVersionMatch(matchers ...interface{}) *ExecutionContext_GetEventVersion { + c_call := _m.On("GetEventVersion", matchers...) + return &ExecutionContext_GetEventVersion{Call: c_call} } // GetEventVersion provides a mock function with given fields: func (_m *ExecutionContext) GetEventVersion() v1alpha1.EventVersion { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetEventVersion") - } - var r0 v1alpha1.EventVersion if rf, ok := ret.Get(0).(func() v1alpha1.EventVersion); ok { r0 = rf() @@ -411,41 +312,28 @@ func (_m *ExecutionContext) GetEventVersion() v1alpha1.EventVersion { return r0 } -// ExecutionContext_GetEventVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEventVersion' -type ExecutionContext_GetEventVersion_Call struct { +type ExecutionContext_GetExecutionConfig struct { *mock.Call } -// GetEventVersion is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetEventVersion() *ExecutionContext_GetEventVersion_Call { - return &ExecutionContext_GetEventVersion_Call{Call: _e.mock.On("GetEventVersion")} -} - -func (_c *ExecutionContext_GetEventVersion_Call) Run(run func()) *ExecutionContext_GetEventVersion_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetExecutionConfig) Return(_a0 v1alpha1.ExecutionConfig) *ExecutionContext_GetExecutionConfig { + return &ExecutionContext_GetExecutionConfig{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetEventVersion_Call) Return(_a0 v1alpha1.EventVersion) *ExecutionContext_GetEventVersion_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetExecutionConfig() *ExecutionContext_GetExecutionConfig { + c_call := _m.On("GetExecutionConfig") + return &ExecutionContext_GetExecutionConfig{Call: c_call} } -func (_c *ExecutionContext_GetEventVersion_Call) RunAndReturn(run func() v1alpha1.EventVersion) *ExecutionContext_GetEventVersion_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetExecutionConfigMatch(matchers ...interface{}) *ExecutionContext_GetExecutionConfig { + c_call := _m.On("GetExecutionConfig", matchers...) + return &ExecutionContext_GetExecutionConfig{Call: c_call} } // GetExecutionConfig provides a mock function with given fields: func (_m *ExecutionContext) GetExecutionConfig() v1alpha1.ExecutionConfig { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetExecutionConfig") - } - var r0 v1alpha1.ExecutionConfig if rf, ok := ret.Get(0).(func() v1alpha1.ExecutionConfig); ok { r0 = rf() @@ -456,41 +344,28 @@ func (_m *ExecutionContext) GetExecutionConfig() v1alpha1.ExecutionConfig { return r0 } -// ExecutionContext_GetExecutionConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExecutionConfig' -type ExecutionContext_GetExecutionConfig_Call struct { +type ExecutionContext_GetExecutionID struct { *mock.Call } -// GetExecutionConfig is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetExecutionConfig() *ExecutionContext_GetExecutionConfig_Call { - return &ExecutionContext_GetExecutionConfig_Call{Call: _e.mock.On("GetExecutionConfig")} -} - -func (_c *ExecutionContext_GetExecutionConfig_Call) Run(run func()) *ExecutionContext_GetExecutionConfig_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetExecutionID) Return(_a0 v1alpha1.WorkflowExecutionIdentifier) *ExecutionContext_GetExecutionID { + return &ExecutionContext_GetExecutionID{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetExecutionConfig_Call) Return(_a0 v1alpha1.ExecutionConfig) *ExecutionContext_GetExecutionConfig_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetExecutionID() *ExecutionContext_GetExecutionID { + c_call := _m.On("GetExecutionID") + return &ExecutionContext_GetExecutionID{Call: c_call} } -func (_c *ExecutionContext_GetExecutionConfig_Call) RunAndReturn(run func() v1alpha1.ExecutionConfig) *ExecutionContext_GetExecutionConfig_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetExecutionIDMatch(matchers ...interface{}) *ExecutionContext_GetExecutionID { + c_call := _m.On("GetExecutionID", matchers...) + return &ExecutionContext_GetExecutionID{Call: c_call} } // GetExecutionID provides a mock function with given fields: func (_m *ExecutionContext) GetExecutionID() v1alpha1.WorkflowExecutionIdentifier { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetExecutionID") - } - var r0 v1alpha1.WorkflowExecutionIdentifier if rf, ok := ret.Get(0).(func() v1alpha1.WorkflowExecutionIdentifier); ok { r0 = rf() @@ -501,41 +376,28 @@ func (_m *ExecutionContext) GetExecutionID() v1alpha1.WorkflowExecutionIdentifie return r0 } -// ExecutionContext_GetExecutionID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExecutionID' -type ExecutionContext_GetExecutionID_Call struct { +type ExecutionContext_GetID struct { *mock.Call } -// GetExecutionID is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetExecutionID() *ExecutionContext_GetExecutionID_Call { - return &ExecutionContext_GetExecutionID_Call{Call: _e.mock.On("GetExecutionID")} -} - -func (_c *ExecutionContext_GetExecutionID_Call) Run(run func()) *ExecutionContext_GetExecutionID_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetID) Return(_a0 string) *ExecutionContext_GetID { + return &ExecutionContext_GetID{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetExecutionID_Call) Return(_a0 v1alpha1.WorkflowExecutionIdentifier) *ExecutionContext_GetExecutionID_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetID() *ExecutionContext_GetID { + c_call := _m.On("GetID") + return &ExecutionContext_GetID{Call: c_call} } -func (_c *ExecutionContext_GetExecutionID_Call) RunAndReturn(run func() v1alpha1.WorkflowExecutionIdentifier) *ExecutionContext_GetExecutionID_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetIDMatch(matchers ...interface{}) *ExecutionContext_GetID { + c_call := _m.On("GetID", matchers...) + return &ExecutionContext_GetID{Call: c_call} } // GetID provides a mock function with given fields: func (_m *ExecutionContext) GetID() string { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetID") - } - var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -546,41 +408,28 @@ func (_m *ExecutionContext) GetID() string { return r0 } -// ExecutionContext_GetID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetID' -type ExecutionContext_GetID_Call struct { +type ExecutionContext_GetK8sWorkflowID struct { *mock.Call } -// GetID is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetID() *ExecutionContext_GetID_Call { - return &ExecutionContext_GetID_Call{Call: _e.mock.On("GetID")} -} - -func (_c *ExecutionContext_GetID_Call) Run(run func()) *ExecutionContext_GetID_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetK8sWorkflowID) Return(_a0 types.NamespacedName) *ExecutionContext_GetK8sWorkflowID { + return &ExecutionContext_GetK8sWorkflowID{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetID_Call) Return(_a0 string) *ExecutionContext_GetID_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetK8sWorkflowID() *ExecutionContext_GetK8sWorkflowID { + c_call := _m.On("GetK8sWorkflowID") + return &ExecutionContext_GetK8sWorkflowID{Call: c_call} } -func (_c *ExecutionContext_GetID_Call) RunAndReturn(run func() string) *ExecutionContext_GetID_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetK8sWorkflowIDMatch(matchers ...interface{}) *ExecutionContext_GetK8sWorkflowID { + c_call := _m.On("GetK8sWorkflowID", matchers...) + return &ExecutionContext_GetK8sWorkflowID{Call: c_call} } // GetK8sWorkflowID provides a mock function with given fields: func (_m *ExecutionContext) GetK8sWorkflowID() types.NamespacedName { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetK8sWorkflowID") - } - var r0 types.NamespacedName if rf, ok := ret.Get(0).(func() types.NamespacedName); ok { r0 = rf() @@ -591,41 +440,28 @@ func (_m *ExecutionContext) GetK8sWorkflowID() types.NamespacedName { return r0 } -// ExecutionContext_GetK8sWorkflowID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetK8sWorkflowID' -type ExecutionContext_GetK8sWorkflowID_Call struct { +type ExecutionContext_GetLabels struct { *mock.Call } -// GetK8sWorkflowID is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetK8sWorkflowID() *ExecutionContext_GetK8sWorkflowID_Call { - return &ExecutionContext_GetK8sWorkflowID_Call{Call: _e.mock.On("GetK8sWorkflowID")} -} - -func (_c *ExecutionContext_GetK8sWorkflowID_Call) Run(run func()) *ExecutionContext_GetK8sWorkflowID_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetLabels) Return(_a0 map[string]string) *ExecutionContext_GetLabels { + return &ExecutionContext_GetLabels{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetK8sWorkflowID_Call) Return(_a0 types.NamespacedName) *ExecutionContext_GetK8sWorkflowID_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetLabels() *ExecutionContext_GetLabels { + c_call := _m.On("GetLabels") + return &ExecutionContext_GetLabels{Call: c_call} } -func (_c *ExecutionContext_GetK8sWorkflowID_Call) RunAndReturn(run func() types.NamespacedName) *ExecutionContext_GetK8sWorkflowID_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetLabelsMatch(matchers ...interface{}) *ExecutionContext_GetLabels { + c_call := _m.On("GetLabels", matchers...) + return &ExecutionContext_GetLabels{Call: c_call} } // GetLabels provides a mock function with given fields: func (_m *ExecutionContext) GetLabels() map[string]string { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetLabels") - } - var r0 map[string]string if rf, ok := ret.Get(0).(func() map[string]string); ok { r0 = rf() @@ -638,41 +474,28 @@ func (_m *ExecutionContext) GetLabels() map[string]string { return r0 } -// ExecutionContext_GetLabels_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLabels' -type ExecutionContext_GetLabels_Call struct { +type ExecutionContext_GetName struct { *mock.Call } -// GetLabels is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetLabels() *ExecutionContext_GetLabels_Call { - return &ExecutionContext_GetLabels_Call{Call: _e.mock.On("GetLabels")} -} - -func (_c *ExecutionContext_GetLabels_Call) Run(run func()) *ExecutionContext_GetLabels_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetName) Return(_a0 string) *ExecutionContext_GetName { + return &ExecutionContext_GetName{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetLabels_Call) Return(_a0 map[string]string) *ExecutionContext_GetLabels_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetName() *ExecutionContext_GetName { + c_call := _m.On("GetName") + return &ExecutionContext_GetName{Call: c_call} } -func (_c *ExecutionContext_GetLabels_Call) RunAndReturn(run func() map[string]string) *ExecutionContext_GetLabels_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetNameMatch(matchers ...interface{}) *ExecutionContext_GetName { + c_call := _m.On("GetName", matchers...) + return &ExecutionContext_GetName{Call: c_call} } // GetName provides a mock function with given fields: func (_m *ExecutionContext) GetName() string { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetName") - } - var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -683,41 +506,28 @@ func (_m *ExecutionContext) GetName() string { return r0 } -// ExecutionContext_GetName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetName' -type ExecutionContext_GetName_Call struct { +type ExecutionContext_GetNamespace struct { *mock.Call } -// GetName is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetName() *ExecutionContext_GetName_Call { - return &ExecutionContext_GetName_Call{Call: _e.mock.On("GetName")} -} - -func (_c *ExecutionContext_GetName_Call) Run(run func()) *ExecutionContext_GetName_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetNamespace) Return(_a0 string) *ExecutionContext_GetNamespace { + return &ExecutionContext_GetNamespace{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetName_Call) Return(_a0 string) *ExecutionContext_GetName_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetNamespace() *ExecutionContext_GetNamespace { + c_call := _m.On("GetNamespace") + return &ExecutionContext_GetNamespace{Call: c_call} } -func (_c *ExecutionContext_GetName_Call) RunAndReturn(run func() string) *ExecutionContext_GetName_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetNamespaceMatch(matchers ...interface{}) *ExecutionContext_GetNamespace { + c_call := _m.On("GetNamespace", matchers...) + return &ExecutionContext_GetNamespace{Call: c_call} } // GetNamespace provides a mock function with given fields: func (_m *ExecutionContext) GetNamespace() string { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetNamespace") - } - var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -728,41 +538,28 @@ func (_m *ExecutionContext) GetNamespace() string { return r0 } -// ExecutionContext_GetNamespace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNamespace' -type ExecutionContext_GetNamespace_Call struct { +type ExecutionContext_GetOnFailurePolicy struct { *mock.Call } -// GetNamespace is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetNamespace() *ExecutionContext_GetNamespace_Call { - return &ExecutionContext_GetNamespace_Call{Call: _e.mock.On("GetNamespace")} -} - -func (_c *ExecutionContext_GetNamespace_Call) Run(run func()) *ExecutionContext_GetNamespace_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetOnFailurePolicy) Return(_a0 v1alpha1.WorkflowOnFailurePolicy) *ExecutionContext_GetOnFailurePolicy { + return &ExecutionContext_GetOnFailurePolicy{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetNamespace_Call) Return(_a0 string) *ExecutionContext_GetNamespace_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetOnFailurePolicy() *ExecutionContext_GetOnFailurePolicy { + c_call := _m.On("GetOnFailurePolicy") + return &ExecutionContext_GetOnFailurePolicy{Call: c_call} } -func (_c *ExecutionContext_GetNamespace_Call) RunAndReturn(run func() string) *ExecutionContext_GetNamespace_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetOnFailurePolicyMatch(matchers ...interface{}) *ExecutionContext_GetOnFailurePolicy { + c_call := _m.On("GetOnFailurePolicy", matchers...) + return &ExecutionContext_GetOnFailurePolicy{Call: c_call} } // GetOnFailurePolicy provides a mock function with given fields: func (_m *ExecutionContext) GetOnFailurePolicy() v1alpha1.WorkflowOnFailurePolicy { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetOnFailurePolicy") - } - var r0 v1alpha1.WorkflowOnFailurePolicy if rf, ok := ret.Get(0).(func() v1alpha1.WorkflowOnFailurePolicy); ok { r0 = rf() @@ -773,41 +570,28 @@ func (_m *ExecutionContext) GetOnFailurePolicy() v1alpha1.WorkflowOnFailurePolic return r0 } -// ExecutionContext_GetOnFailurePolicy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOnFailurePolicy' -type ExecutionContext_GetOnFailurePolicy_Call struct { +type ExecutionContext_GetOwnerReference struct { *mock.Call } -// GetOnFailurePolicy is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetOnFailurePolicy() *ExecutionContext_GetOnFailurePolicy_Call { - return &ExecutionContext_GetOnFailurePolicy_Call{Call: _e.mock.On("GetOnFailurePolicy")} -} - -func (_c *ExecutionContext_GetOnFailurePolicy_Call) Run(run func()) *ExecutionContext_GetOnFailurePolicy_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetOwnerReference) Return(_a0 v1.OwnerReference) *ExecutionContext_GetOwnerReference { + return &ExecutionContext_GetOwnerReference{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetOnFailurePolicy_Call) Return(_a0 v1alpha1.WorkflowOnFailurePolicy) *ExecutionContext_GetOnFailurePolicy_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetOwnerReference() *ExecutionContext_GetOwnerReference { + c_call := _m.On("GetOwnerReference") + return &ExecutionContext_GetOwnerReference{Call: c_call} } -func (_c *ExecutionContext_GetOnFailurePolicy_Call) RunAndReturn(run func() v1alpha1.WorkflowOnFailurePolicy) *ExecutionContext_GetOnFailurePolicy_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetOwnerReferenceMatch(matchers ...interface{}) *ExecutionContext_GetOwnerReference { + c_call := _m.On("GetOwnerReference", matchers...) + return &ExecutionContext_GetOwnerReference{Call: c_call} } // GetOwnerReference provides a mock function with given fields: func (_m *ExecutionContext) GetOwnerReference() v1.OwnerReference { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetOwnerReference") - } - var r0 v1.OwnerReference if rf, ok := ret.Get(0).(func() v1.OwnerReference); ok { r0 = rf() @@ -818,41 +602,28 @@ func (_m *ExecutionContext) GetOwnerReference() v1.OwnerReference { return r0 } -// ExecutionContext_GetOwnerReference_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOwnerReference' -type ExecutionContext_GetOwnerReference_Call struct { +type ExecutionContext_GetParentInfo struct { *mock.Call } -// GetOwnerReference is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetOwnerReference() *ExecutionContext_GetOwnerReference_Call { - return &ExecutionContext_GetOwnerReference_Call{Call: _e.mock.On("GetOwnerReference")} -} - -func (_c *ExecutionContext_GetOwnerReference_Call) Run(run func()) *ExecutionContext_GetOwnerReference_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetParentInfo) Return(_a0 executors.ImmutableParentInfo) *ExecutionContext_GetParentInfo { + return &ExecutionContext_GetParentInfo{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetOwnerReference_Call) Return(_a0 v1.OwnerReference) *ExecutionContext_GetOwnerReference_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetParentInfo() *ExecutionContext_GetParentInfo { + c_call := _m.On("GetParentInfo") + return &ExecutionContext_GetParentInfo{Call: c_call} } -func (_c *ExecutionContext_GetOwnerReference_Call) RunAndReturn(run func() v1.OwnerReference) *ExecutionContext_GetOwnerReference_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetParentInfoMatch(matchers ...interface{}) *ExecutionContext_GetParentInfo { + c_call := _m.On("GetParentInfo", matchers...) + return &ExecutionContext_GetParentInfo{Call: c_call} } // GetParentInfo provides a mock function with given fields: func (_m *ExecutionContext) GetParentInfo() executors.ImmutableParentInfo { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetParentInfo") - } - var r0 executors.ImmutableParentInfo if rf, ok := ret.Get(0).(func() executors.ImmutableParentInfo); ok { r0 = rf() @@ -865,41 +636,28 @@ func (_m *ExecutionContext) GetParentInfo() executors.ImmutableParentInfo { return r0 } -// ExecutionContext_GetParentInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParentInfo' -type ExecutionContext_GetParentInfo_Call struct { +type ExecutionContext_GetRawOutputDataConfig struct { *mock.Call } -// GetParentInfo is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetParentInfo() *ExecutionContext_GetParentInfo_Call { - return &ExecutionContext_GetParentInfo_Call{Call: _e.mock.On("GetParentInfo")} -} - -func (_c *ExecutionContext_GetParentInfo_Call) Run(run func()) *ExecutionContext_GetParentInfo_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetRawOutputDataConfig) Return(_a0 v1alpha1.RawOutputDataConfig) *ExecutionContext_GetRawOutputDataConfig { + return &ExecutionContext_GetRawOutputDataConfig{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetParentInfo_Call) Return(_a0 executors.ImmutableParentInfo) *ExecutionContext_GetParentInfo_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetRawOutputDataConfig() *ExecutionContext_GetRawOutputDataConfig { + c_call := _m.On("GetRawOutputDataConfig") + return &ExecutionContext_GetRawOutputDataConfig{Call: c_call} } -func (_c *ExecutionContext_GetParentInfo_Call) RunAndReturn(run func() executors.ImmutableParentInfo) *ExecutionContext_GetParentInfo_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetRawOutputDataConfigMatch(matchers ...interface{}) *ExecutionContext_GetRawOutputDataConfig { + c_call := _m.On("GetRawOutputDataConfig", matchers...) + return &ExecutionContext_GetRawOutputDataConfig{Call: c_call} } // GetRawOutputDataConfig provides a mock function with given fields: func (_m *ExecutionContext) GetRawOutputDataConfig() v1alpha1.RawOutputDataConfig { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetRawOutputDataConfig") - } - var r0 v1alpha1.RawOutputDataConfig if rf, ok := ret.Get(0).(func() v1alpha1.RawOutputDataConfig); ok { r0 = rf() @@ -910,41 +668,28 @@ func (_m *ExecutionContext) GetRawOutputDataConfig() v1alpha1.RawOutputDataConfi return r0 } -// ExecutionContext_GetRawOutputDataConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRawOutputDataConfig' -type ExecutionContext_GetRawOutputDataConfig_Call struct { +type ExecutionContext_GetSecurityContext struct { *mock.Call } -// GetRawOutputDataConfig is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetRawOutputDataConfig() *ExecutionContext_GetRawOutputDataConfig_Call { - return &ExecutionContext_GetRawOutputDataConfig_Call{Call: _e.mock.On("GetRawOutputDataConfig")} -} - -func (_c *ExecutionContext_GetRawOutputDataConfig_Call) Run(run func()) *ExecutionContext_GetRawOutputDataConfig_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetSecurityContext) Return(_a0 core.SecurityContext) *ExecutionContext_GetSecurityContext { + return &ExecutionContext_GetSecurityContext{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetRawOutputDataConfig_Call) Return(_a0 v1alpha1.RawOutputDataConfig) *ExecutionContext_GetRawOutputDataConfig_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetSecurityContext() *ExecutionContext_GetSecurityContext { + c_call := _m.On("GetSecurityContext") + return &ExecutionContext_GetSecurityContext{Call: c_call} } -func (_c *ExecutionContext_GetRawOutputDataConfig_Call) RunAndReturn(run func() v1alpha1.RawOutputDataConfig) *ExecutionContext_GetRawOutputDataConfig_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetSecurityContextMatch(matchers ...interface{}) *ExecutionContext_GetSecurityContext { + c_call := _m.On("GetSecurityContext", matchers...) + return &ExecutionContext_GetSecurityContext{Call: c_call} } // GetSecurityContext provides a mock function with given fields: func (_m *ExecutionContext) GetSecurityContext() core.SecurityContext { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetSecurityContext") - } - var r0 core.SecurityContext if rf, ok := ret.Get(0).(func() core.SecurityContext); ok { r0 = rf() @@ -955,41 +700,28 @@ func (_m *ExecutionContext) GetSecurityContext() core.SecurityContext { return r0 } -// ExecutionContext_GetSecurityContext_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSecurityContext' -type ExecutionContext_GetSecurityContext_Call struct { +type ExecutionContext_GetServiceAccountName struct { *mock.Call } -// GetSecurityContext is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetSecurityContext() *ExecutionContext_GetSecurityContext_Call { - return &ExecutionContext_GetSecurityContext_Call{Call: _e.mock.On("GetSecurityContext")} -} - -func (_c *ExecutionContext_GetSecurityContext_Call) Run(run func()) *ExecutionContext_GetSecurityContext_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetServiceAccountName) Return(_a0 string) *ExecutionContext_GetServiceAccountName { + return &ExecutionContext_GetServiceAccountName{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetSecurityContext_Call) Return(_a0 core.SecurityContext) *ExecutionContext_GetSecurityContext_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetServiceAccountName() *ExecutionContext_GetServiceAccountName { + c_call := _m.On("GetServiceAccountName") + return &ExecutionContext_GetServiceAccountName{Call: c_call} } -func (_c *ExecutionContext_GetSecurityContext_Call) RunAndReturn(run func() core.SecurityContext) *ExecutionContext_GetSecurityContext_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetServiceAccountNameMatch(matchers ...interface{}) *ExecutionContext_GetServiceAccountName { + c_call := _m.On("GetServiceAccountName", matchers...) + return &ExecutionContext_GetServiceAccountName{Call: c_call} } // GetServiceAccountName provides a mock function with given fields: func (_m *ExecutionContext) GetServiceAccountName() string { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for GetServiceAccountName") - } - var r0 string if rf, ok := ret.Get(0).(func() string); ok { r0 = rf() @@ -1000,46 +732,29 @@ func (_m *ExecutionContext) GetServiceAccountName() string { return r0 } -// ExecutionContext_GetServiceAccountName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetServiceAccountName' -type ExecutionContext_GetServiceAccountName_Call struct { +type ExecutionContext_GetTask struct { *mock.Call } -// GetServiceAccountName is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) GetServiceAccountName() *ExecutionContext_GetServiceAccountName_Call { - return &ExecutionContext_GetServiceAccountName_Call{Call: _e.mock.On("GetServiceAccountName")} -} - -func (_c *ExecutionContext_GetServiceAccountName_Call) Run(run func()) *ExecutionContext_GetServiceAccountName_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_GetTask) Return(_a0 v1alpha1.ExecutableTask, _a1 error) *ExecutionContext_GetTask { + return &ExecutionContext_GetTask{Call: _m.Call.Return(_a0, _a1)} } -func (_c *ExecutionContext_GetServiceAccountName_Call) Return(_a0 string) *ExecutionContext_GetServiceAccountName_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnGetTask(id string) *ExecutionContext_GetTask { + c_call := _m.On("GetTask", id) + return &ExecutionContext_GetTask{Call: c_call} } -func (_c *ExecutionContext_GetServiceAccountName_Call) RunAndReturn(run func() string) *ExecutionContext_GetServiceAccountName_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnGetTaskMatch(matchers ...interface{}) *ExecutionContext_GetTask { + c_call := _m.On("GetTask", matchers...) + return &ExecutionContext_GetTask{Call: c_call} } // GetTask provides a mock function with given fields: id func (_m *ExecutionContext) GetTask(id string) (v1alpha1.ExecutableTask, error) { ret := _m.Called(id) - if len(ret) == 0 { - panic("no return value specified for GetTask") - } - var r0 v1alpha1.ExecutableTask - var r1 error - if rf, ok := ret.Get(0).(func(string) (v1alpha1.ExecutableTask, error)); ok { - return rf(id) - } if rf, ok := ret.Get(0).(func(string) v1alpha1.ExecutableTask); ok { r0 = rf(id) } else { @@ -1048,6 +763,7 @@ func (_m *ExecutionContext) GetTask(id string) (v1alpha1.ExecutableTask, error) } } + var r1 error if rf, ok := ret.Get(1).(func(string) error); ok { r1 = rf(id) } else { @@ -1057,42 +773,28 @@ func (_m *ExecutionContext) GetTask(id string) (v1alpha1.ExecutableTask, error) return r0, r1 } -// ExecutionContext_GetTask_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTask' -type ExecutionContext_GetTask_Call struct { +type ExecutionContext_IncrementNodeExecutionCount struct { *mock.Call } -// GetTask is a helper method to define mock.On call -// - id string -func (_e *ExecutionContext_Expecter) GetTask(id interface{}) *ExecutionContext_GetTask_Call { - return &ExecutionContext_GetTask_Call{Call: _e.mock.On("GetTask", id)} -} - -func (_c *ExecutionContext_GetTask_Call) Run(run func(id string)) *ExecutionContext_GetTask_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(string)) - }) - return _c +func (_m ExecutionContext_IncrementNodeExecutionCount) Return(_a0 uint32) *ExecutionContext_IncrementNodeExecutionCount { + return &ExecutionContext_IncrementNodeExecutionCount{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_GetTask_Call) Return(_a0 v1alpha1.ExecutableTask, _a1 error) *ExecutionContext_GetTask_Call { - _c.Call.Return(_a0, _a1) - return _c +func (_m *ExecutionContext) OnIncrementNodeExecutionCount() *ExecutionContext_IncrementNodeExecutionCount { + c_call := _m.On("IncrementNodeExecutionCount") + return &ExecutionContext_IncrementNodeExecutionCount{Call: c_call} } -func (_c *ExecutionContext_GetTask_Call) RunAndReturn(run func(string) (v1alpha1.ExecutableTask, error)) *ExecutionContext_GetTask_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnIncrementNodeExecutionCountMatch(matchers ...interface{}) *ExecutionContext_IncrementNodeExecutionCount { + c_call := _m.On("IncrementNodeExecutionCount", matchers...) + return &ExecutionContext_IncrementNodeExecutionCount{Call: c_call} } // IncrementNodeExecutionCount provides a mock function with given fields: func (_m *ExecutionContext) IncrementNodeExecutionCount() uint32 { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for IncrementNodeExecutionCount") - } - var r0 uint32 if rf, ok := ret.Get(0).(func() uint32); ok { r0 = rf() @@ -1103,41 +805,28 @@ func (_m *ExecutionContext) IncrementNodeExecutionCount() uint32 { return r0 } -// ExecutionContext_IncrementNodeExecutionCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncrementNodeExecutionCount' -type ExecutionContext_IncrementNodeExecutionCount_Call struct { +type ExecutionContext_IncrementParallelism struct { *mock.Call } -// IncrementNodeExecutionCount is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) IncrementNodeExecutionCount() *ExecutionContext_IncrementNodeExecutionCount_Call { - return &ExecutionContext_IncrementNodeExecutionCount_Call{Call: _e.mock.On("IncrementNodeExecutionCount")} -} - -func (_c *ExecutionContext_IncrementNodeExecutionCount_Call) Run(run func()) *ExecutionContext_IncrementNodeExecutionCount_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_IncrementParallelism) Return(_a0 uint32) *ExecutionContext_IncrementParallelism { + return &ExecutionContext_IncrementParallelism{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_IncrementNodeExecutionCount_Call) Return(_a0 uint32) *ExecutionContext_IncrementNodeExecutionCount_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnIncrementParallelism() *ExecutionContext_IncrementParallelism { + c_call := _m.On("IncrementParallelism") + return &ExecutionContext_IncrementParallelism{Call: c_call} } -func (_c *ExecutionContext_IncrementNodeExecutionCount_Call) RunAndReturn(run func() uint32) *ExecutionContext_IncrementNodeExecutionCount_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnIncrementParallelismMatch(matchers ...interface{}) *ExecutionContext_IncrementParallelism { + c_call := _m.On("IncrementParallelism", matchers...) + return &ExecutionContext_IncrementParallelism{Call: c_call} } // IncrementParallelism provides a mock function with given fields: func (_m *ExecutionContext) IncrementParallelism() uint32 { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for IncrementParallelism") - } - var r0 uint32 if rf, ok := ret.Get(0).(func() uint32); ok { r0 = rf() @@ -1148,41 +837,28 @@ func (_m *ExecutionContext) IncrementParallelism() uint32 { return r0 } -// ExecutionContext_IncrementParallelism_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncrementParallelism' -type ExecutionContext_IncrementParallelism_Call struct { +type ExecutionContext_IncrementTaskExecutionCount struct { *mock.Call } -// IncrementParallelism is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) IncrementParallelism() *ExecutionContext_IncrementParallelism_Call { - return &ExecutionContext_IncrementParallelism_Call{Call: _e.mock.On("IncrementParallelism")} -} - -func (_c *ExecutionContext_IncrementParallelism_Call) Run(run func()) *ExecutionContext_IncrementParallelism_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_IncrementTaskExecutionCount) Return(_a0 uint32) *ExecutionContext_IncrementTaskExecutionCount { + return &ExecutionContext_IncrementTaskExecutionCount{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_IncrementParallelism_Call) Return(_a0 uint32) *ExecutionContext_IncrementParallelism_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnIncrementTaskExecutionCount() *ExecutionContext_IncrementTaskExecutionCount { + c_call := _m.On("IncrementTaskExecutionCount") + return &ExecutionContext_IncrementTaskExecutionCount{Call: c_call} } -func (_c *ExecutionContext_IncrementParallelism_Call) RunAndReturn(run func() uint32) *ExecutionContext_IncrementParallelism_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnIncrementTaskExecutionCountMatch(matchers ...interface{}) *ExecutionContext_IncrementTaskExecutionCount { + c_call := _m.On("IncrementTaskExecutionCount", matchers...) + return &ExecutionContext_IncrementTaskExecutionCount{Call: c_call} } // IncrementTaskExecutionCount provides a mock function with given fields: func (_m *ExecutionContext) IncrementTaskExecutionCount() uint32 { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for IncrementTaskExecutionCount") - } - var r0 uint32 if rf, ok := ret.Get(0).(func() uint32); ok { r0 = rf() @@ -1193,41 +869,28 @@ func (_m *ExecutionContext) IncrementTaskExecutionCount() uint32 { return r0 } -// ExecutionContext_IncrementTaskExecutionCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IncrementTaskExecutionCount' -type ExecutionContext_IncrementTaskExecutionCount_Call struct { +type ExecutionContext_IsInterruptible struct { *mock.Call } -// IncrementTaskExecutionCount is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) IncrementTaskExecutionCount() *ExecutionContext_IncrementTaskExecutionCount_Call { - return &ExecutionContext_IncrementTaskExecutionCount_Call{Call: _e.mock.On("IncrementTaskExecutionCount")} -} - -func (_c *ExecutionContext_IncrementTaskExecutionCount_Call) Run(run func()) *ExecutionContext_IncrementTaskExecutionCount_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c +func (_m ExecutionContext_IsInterruptible) Return(_a0 bool) *ExecutionContext_IsInterruptible { + return &ExecutionContext_IsInterruptible{Call: _m.Call.Return(_a0)} } -func (_c *ExecutionContext_IncrementTaskExecutionCount_Call) Return(_a0 uint32) *ExecutionContext_IncrementTaskExecutionCount_Call { - _c.Call.Return(_a0) - return _c +func (_m *ExecutionContext) OnIsInterruptible() *ExecutionContext_IsInterruptible { + c_call := _m.On("IsInterruptible") + return &ExecutionContext_IsInterruptible{Call: c_call} } -func (_c *ExecutionContext_IncrementTaskExecutionCount_Call) RunAndReturn(run func() uint32) *ExecutionContext_IncrementTaskExecutionCount_Call { - _c.Call.Return(run) - return _c +func (_m *ExecutionContext) OnIsInterruptibleMatch(matchers ...interface{}) *ExecutionContext_IsInterruptible { + c_call := _m.On("IsInterruptible", matchers...) + return &ExecutionContext_IsInterruptible{Call: c_call} } // IsInterruptible provides a mock function with given fields: func (_m *ExecutionContext) IsInterruptible() bool { ret := _m.Called() - if len(ret) == 0 { - panic("no return value specified for IsInterruptible") - } - var r0 bool if rf, ok := ret.Get(0).(func() bool); ok { r0 = rf() @@ -1237,44 +900,3 @@ func (_m *ExecutionContext) IsInterruptible() bool { return r0 } - -// ExecutionContext_IsInterruptible_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsInterruptible' -type ExecutionContext_IsInterruptible_Call struct { - *mock.Call -} - -// IsInterruptible is a helper method to define mock.On call -func (_e *ExecutionContext_Expecter) IsInterruptible() *ExecutionContext_IsInterruptible_Call { - return &ExecutionContext_IsInterruptible_Call{Call: _e.mock.On("IsInterruptible")} -} - -func (_c *ExecutionContext_IsInterruptible_Call) Run(run func()) *ExecutionContext_IsInterruptible_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *ExecutionContext_IsInterruptible_Call) Return(_a0 bool) *ExecutionContext_IsInterruptible_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *ExecutionContext_IsInterruptible_Call) RunAndReturn(run func() bool) *ExecutionContext_IsInterruptible_Call { - _c.Call.Return(run) - return _c -} - -// NewExecutionContext creates a new instance of ExecutionContext. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewExecutionContext(t interface { - mock.TestingT - Cleanup(func()) -}) *ExecutionContext { - mock := &ExecutionContext{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/flytepropeller/pkg/controller/executors/mocks/immutable_execution_context.go b/flytepropeller/pkg/controller/executors/mocks/immutable_execution_context.go index 516df9d933..b50cc47447 100644 --- a/flytepropeller/pkg/controller/executors/mocks/immutable_execution_context.go +++ b/flytepropeller/pkg/controller/executors/mocks/immutable_execution_context.go @@ -53,6 +53,38 @@ func (_m *ImmutableExecutionContext) GetAnnotations() map[string]string { return r0 } +type ImmutableExecutionContext_GetConsoleURL struct { + *mock.Call +} + +func (_m ImmutableExecutionContext_GetConsoleURL) Return(_a0 string) *ImmutableExecutionContext_GetConsoleURL { + return &ImmutableExecutionContext_GetConsoleURL{Call: _m.Call.Return(_a0)} +} + +func (_m *ImmutableExecutionContext) OnGetConsoleURL() *ImmutableExecutionContext_GetConsoleURL { + c_call := _m.On("GetConsoleURL") + return &ImmutableExecutionContext_GetConsoleURL{Call: c_call} +} + +func (_m *ImmutableExecutionContext) OnGetConsoleURLMatch(matchers ...interface{}) *ImmutableExecutionContext_GetConsoleURL { + c_call := _m.On("GetConsoleURL", matchers...) + return &ImmutableExecutionContext_GetConsoleURL{Call: c_call} +} + +// GetConsoleURL provides a mock function with given fields: +func (_m *ImmutableExecutionContext) GetConsoleURL() string { + ret := _m.Called() + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + type ImmutableExecutionContext_GetCreationTimestamp struct { *mock.Call } diff --git a/flytepropeller/pkg/controller/nodes/array/handler_test.go b/flytepropeller/pkg/controller/nodes/array/handler_test.go index e906318975..ee1fc5b80b 100644 --- a/flytepropeller/pkg/controller/nodes/array/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/array/handler_test.go @@ -91,11 +91,11 @@ func createNodeExecutionContext(dataStore *storage.DataStore, eventRecorder inte // ExecutionContext executionContext := &execmocks.ExecutionContext{} - executionContext.EXPECT().GetEventVersion().Return(1) - executionContext.EXPECT().GetExecutionConfig().Return(v1alpha1.ExecutionConfig{ + executionContext.OnGetEventVersion().Return(1) + executionContext.OnGetExecutionConfig().Return(v1alpha1.ExecutionConfig{ MaxParallelism: maxParallelism, }) - executionContext.EXPECT().GetExecutionID().Return( + executionContext.OnGetExecutionID().Return( v1alpha1.ExecutionID{ WorkflowExecutionIdentifier: &idlcore.WorkflowExecutionIdentifier{ Project: "project", @@ -103,15 +103,15 @@ func createNodeExecutionContext(dataStore *storage.DataStore, eventRecorder inte Name: "name", }, }) - executionContext.EXPECT().GetLabels().Return(nil) - executionContext.EXPECT().GetRawOutputDataConfig().Return(v1alpha1.RawOutputDataConfig{}) - executionContext.EXPECT().IsInterruptible().Return(false) - executionContext.EXPECT().GetParentInfo().Return(nil) + executionContext.OnGetLabels().Return(nil) + executionContext.OnGetRawOutputDataConfig().Return(v1alpha1.RawOutputDataConfig{}) + executionContext.OnIsInterruptible().Return(false) + executionContext.OnGetParentInfo().Return(nil) outputVariableMap := make(map[string]*idlcore.Variable) for _, outputVariable := range outputVariables { outputVariableMap[outputVariable] = &idlcore.Variable{} } - executionContext.EXPECT().GetTask(taskRef).Return( + executionContext.OnGetTask(taskRef).Return( &v1alpha1.TaskSpec{ TaskTemplate: &idlcore.TaskTemplate{ Interface: &idlcore.TypedInterface{ @@ -123,12 +123,12 @@ func createNodeExecutionContext(dataStore *storage.DataStore, eventRecorder inte }, nil, ) - executionContext.EXPECT().CurrentParallelism().Return(currentParallelism) + executionContext.OnCurrentParallelism().Return(currentParallelism) executionContext.On("IncrementParallelism").Run(func(args mock.Arguments) {}).Return(currentParallelism) - executionContext.EXPECT().IncrementNodeExecutionCount().Return(1) - executionContext.EXPECT().IncrementTaskExecutionCount().Return(1) - executionContext.EXPECT().CurrentNodeExecutionCount().Return(1) - executionContext.EXPECT().CurrentTaskExecutionCount().Return(1) + executionContext.OnIncrementNodeExecutionCount().Return(1) + executionContext.OnIncrementTaskExecutionCount().Return(1) + executionContext.OnCurrentNodeExecutionCount().Return(1) + executionContext.OnCurrentTaskExecutionCount().Return(1) nCtx.OnExecutionContext().Return(executionContext) // EventsRecorder diff --git a/flytepropeller/pkg/controller/nodes/branch/handler_test.go b/flytepropeller/pkg/controller/nodes/branch/handler_test.go index f7f2836018..a48344020d 100644 --- a/flytepropeller/pkg/controller/nodes/branch/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/branch/handler_test.go @@ -185,7 +185,7 @@ func TestBranchHandler_RecurseDownstream(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { eCtx := &execMocks.ExecutionContext{} - eCtx.EXPECT().GetParentInfo().Return(parentInfo{}) + eCtx.OnGetParentInfo().Return(parentInfo{}) mockNodeLookup := &execMocks.NodeLookup{} if len(test.upstreamNodeID) > 0 { @@ -309,7 +309,7 @@ func TestBranchHandler_AbortNode(t *testing.T) { mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(fmt.Errorf("err")) eCtx := &execMocks.ExecutionContext{} - eCtx.EXPECT().GetParentInfo().Return(nil) + eCtx.OnGetParentInfo().Return(nil) nCtx, _ := createNodeContext(v1alpha1.BranchNodeError, nil, n, nil, nil, eCtx) branch := New(mockNodeExecutor, eventConfig, promutils.NewTestScope()) err := branch.Abort(ctx, nCtx, "") @@ -321,7 +321,7 @@ func TestBranchHandler_AbortNode(t *testing.T) { mockNodeLookup := &execMocks.NodeLookup{} mockNodeLookup.OnToNodeMatch(mock.Anything).Return(nil, nil) eCtx := &execMocks.ExecutionContext{} - eCtx.EXPECT().GetParentInfo().Return(parentInfo{}) + eCtx.OnGetParentInfo().Return(parentInfo{}) nCtx, s := createNodeContext(v1alpha1.BranchNodeSuccess, &n1, n, nil, mockNodeLookup, eCtx) newParentInfo, _ := common.CreateParentInfo(parentInfo{}, nCtx.NodeID(), nCtx.CurrentAttempt(), false) expectedExecContext := executors.NewExecutionContextWithParentInfo(nCtx.ExecutionContext(), newParentInfo) @@ -382,7 +382,7 @@ func TestBranchHandler_HandleNode(t *testing.T) { n.OnGetBranchNode().Return(nil) n.OnGetID().Return("n1") eCtx := &execMocks.ExecutionContext{} - eCtx.EXPECT().GetParentInfo().Return(nil) + eCtx.OnGetParentInfo().Return(nil) nCtx, _ := createNodeContext(v1alpha1.BranchNodeSuccess, &childNodeID, n, inputs, nil, eCtx) s, err := branch.Handle(ctx, nCtx) diff --git a/flytepropeller/pkg/controller/nodes/cache_test.go b/flytepropeller/pkg/controller/nodes/cache_test.go index 05d6ecfeaa..fa9eecadb2 100644 --- a/flytepropeller/pkg/controller/nodes/cache_test.go +++ b/flytepropeller/pkg/controller/nodes/cache_test.go @@ -61,8 +61,8 @@ func setupCacheableNodeExecutionContext(dataStore *storage.DataStore, taskTempla mockParentInfo.OnGetUniqueIDMatch().Return(uniqueID) mockExecutionContext := &executorsmocks.ExecutionContext{} - mockExecutionContext.EXPECT().GetParentInfo().Return(mockParentInfo) - mockExecutionContext.EXPECT().GetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) + mockExecutionContext.OnGetParentInfo().Return(mockParentInfo) + mockExecutionContext.OnGetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) mockNodeExecutionMetadata := &interfacesmocks.NodeExecutionMetadata{} mockNodeExecutionMetadata.OnGetOwnerID().Return( diff --git a/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go b/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go index 526f41977a..389ea0439b 100644 --- a/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go +++ b/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go @@ -193,8 +193,8 @@ func Test_dynamicNodeHandler_buildContextualDynamicWorkflow_withLaunchPlans(t *t immutableParentInfo := mocks4.ImmutableParentInfo{} immutableParentInfo.OnGetUniqueID().Return("c1") immutableParentInfo.OnCurrentAttempt().Return(uint32(2)) - execContext.EXPECT().GetParentInfo().Return(&immutableParentInfo) - execContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion1) + execContext.OnGetParentInfo().Return(&immutableParentInfo) + execContext.OnGetEventVersion().Return(v1alpha1.EventVersion1) nCtx.OnExecutionContext().Return(execContext) dCtx, err := d.buildContextualDynamicWorkflow(ctx, nCtx) @@ -262,8 +262,8 @@ func Test_dynamicNodeHandler_buildContextualDynamicWorkflow_withLaunchPlans(t *t } execContext := &mocks4.ExecutionContext{} - execContext.EXPECT().GetParentInfo().Return(nil) - execContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion0) + execContext.OnGetParentInfo().Return(nil) + execContext.OnGetEventVersion().Return(v1alpha1.EventVersion0) nCtx.OnExecutionContext().Return(execContext) dCtx, err := d.buildContextualDynamicWorkflow(ctx, nCtx) @@ -330,8 +330,8 @@ func Test_dynamicNodeHandler_buildContextualDynamicWorkflow_withLaunchPlans(t *t metrics: newMetrics(promutils.NewTestScope()), } execContext := &mocks4.ExecutionContext{} - execContext.EXPECT().GetParentInfo().Return(nil) - execContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion0) + execContext.OnGetParentInfo().Return(nil) + execContext.OnGetEventVersion().Return(v1alpha1.EventVersion0) nCtx.OnExecutionContext().Return(execContext) _, err = d.buildContextualDynamicWorkflow(ctx, nCtx) @@ -417,8 +417,8 @@ func Test_dynamicNodeHandler_buildContextualDynamicWorkflow_withLaunchPlans(t *t immutableParentInfo := mocks4.ImmutableParentInfo{} immutableParentInfo.OnGetUniqueID().Return("c1") immutableParentInfo.OnCurrentAttempt().Return(uint32(2)) - execContext.EXPECT().GetParentInfo().Return(&immutableParentInfo) - execContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion1) + execContext.OnGetParentInfo().Return(&immutableParentInfo) + execContext.OnGetEventVersion().Return(v1alpha1.EventVersion1) nCtx.OnExecutionContext().Return(execContext) dCtx, err := d.buildContextualDynamicWorkflow(ctx, nCtx) @@ -471,8 +471,8 @@ func Test_dynamicNodeHandler_buildContextualDynamicWorkflow_withLaunchPlans(t *t immutableParentInfo := mocks4.ImmutableParentInfo{} immutableParentInfo.OnGetUniqueID().Return("c1") immutableParentInfo.OnCurrentAttempt().Return(uint32(2)) - execContext.EXPECT().GetParentInfo().Return(&immutableParentInfo) - execContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion1) + execContext.OnGetParentInfo().Return(&immutableParentInfo) + execContext.OnGetEventVersion().Return(v1alpha1.EventVersion1) nCtx.OnExecutionContext().Return(execContext) _, err := d.buildContextualDynamicWorkflow(ctx, nCtx) @@ -560,9 +560,9 @@ func Test_dynamicNodeHandler_buildContextualDynamicWorkflow_withLaunchPlans(t *t immutableParentInfo := mocks4.ImmutableParentInfo{} immutableParentInfo.OnGetUniqueID().Return("c1") immutableParentInfo.OnCurrentAttempt().Return(uint32(2)) - execContext.EXPECT().GetParentInfo().Return(&immutableParentInfo) - execContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion1) - execContext.EXPECT().GetExecutionConfig().Return(v1alpha1.ExecutionConfig{ + execContext.OnGetParentInfo().Return(&immutableParentInfo) + execContext.OnGetEventVersion().Return(v1alpha1.EventVersion1) + execContext.OnGetExecutionConfig().Return(v1alpha1.ExecutionConfig{ RecoveryExecution: v1alpha1.WorkflowExecutionIdentifier{}, }) nCtx.OnExecutionContext().Return(execContext) diff --git a/flytepropeller/pkg/controller/nodes/dynamic/handler_test.go b/flytepropeller/pkg/controller/nodes/dynamic/handler_test.go index 16acd4b699..bab7b48f1b 100644 --- a/flytepropeller/pkg/controller/nodes/dynamic/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/dynamic/handler_test.go @@ -576,12 +576,12 @@ func Test_dynamicNodeHandler_Handle_SubTaskV1(t *testing.T) { assert.NoError(t, nCtx.DataStore().WriteProtobuf(context.TODO(), endF, storage.Options{}, &core.LiteralMap{})) } execContext := executorMocks.ExecutionContext{} - execContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion1) + execContext.OnGetEventVersion().Return(v1alpha1.EventVersion1) immutableParentInfo := executorMocks.ImmutableParentInfo{} immutableParentInfo.OnGetUniqueID().Return("c1") immutableParentInfo.OnCurrentAttempt().Return(uint32(2)) - execContext.EXPECT().GetParentInfo().Return(&immutableParentInfo) - execContext.EXPECT().GetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) + execContext.OnGetParentInfo().Return(&immutableParentInfo) + execContext.OnGetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) nCtx.OnExecutionContext().Return(&execContext) d := New(h, n, mockLPLauncher, eventConfig, promutils.NewTestScope()) got, err := d.Handle(context.TODO(), nCtx) @@ -766,9 +766,9 @@ func Test_dynamicNodeHandler_Handle_SubTask(t *testing.T) { assert.NoError(t, nCtx.DataStore().WriteProtobuf(context.TODO(), endF, storage.Options{}, &core.LiteralMap{})) } execContext := executorMocks.ExecutionContext{} - execContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion0) - execContext.EXPECT().GetParentInfo().Return(nil) - execContext.EXPECT().GetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) + execContext.OnGetEventVersion().Return(v1alpha1.EventVersion0) + execContext.OnGetParentInfo().Return(nil) + execContext.OnGetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) nCtx.OnExecutionContext().Return(&execContext) d := New(h, n, mockLPLauncher, eventConfig, promutils.NewTestScope()) got, err := d.Handle(context.TODO(), nCtx) @@ -913,8 +913,8 @@ func TestDynamicNodeTaskNodeHandler_Finalize(t *testing.T) { nCtx.OnEnqueueOwnerFunc().Return(func() error { return nil }) nCtx.OnDataStore().Return(dataStore) execContext := executorMocks.ExecutionContext{} - execContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion0) - execContext.EXPECT().GetParentInfo().Return(nil) + execContext.OnGetEventVersion().Return(v1alpha1.EventVersion0) + execContext.OnGetParentInfo().Return(nil) nCtx.OnExecutionContext().Return(&execContext) endNodeStatus := &flyteMocks.ExecutableNodeStatus{} diff --git a/flytepropeller/pkg/controller/nodes/executor_test.go b/flytepropeller/pkg/controller/nodes/executor_test.go index 783821c9ab..ea7da42112 100644 --- a/flytepropeller/pkg/controller/nodes/executor_test.go +++ b/flytepropeller/pkg/controller/nodes/executor_test.go @@ -1301,20 +1301,20 @@ func TestNodeExecutor_RecursiveNodeHandler_BranchNode(t *testing.T) { tid := "tid" eCtx := &mocks4.ExecutionContext{} - eCtx.EXPECT().GetTask(tid).Return(tk, nil) - - eCtx.EXPECT().IsInterruptible().Return(true) - eCtx.EXPECT().GetExecutionID().Return(v1alpha1.WorkflowExecutionIdentifier{WorkflowExecutionIdentifier: &core.WorkflowExecutionIdentifier{}}) - eCtx.EXPECT().GetLabels().Return(nil) - eCtx.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion0) - eCtx.EXPECT().GetParentInfo().Return(nil) - eCtx.EXPECT().GetRawOutputDataConfig().Return(v1alpha1.RawOutputDataConfig{ + eCtx.OnGetTask(tid).Return(tk, nil) + + eCtx.OnIsInterruptible().Return(true) + eCtx.OnGetExecutionID().Return(v1alpha1.WorkflowExecutionIdentifier{WorkflowExecutionIdentifier: &core.WorkflowExecutionIdentifier{}}) + eCtx.OnGetLabels().Return(nil) + eCtx.OnGetEventVersion().Return(v1alpha1.EventVersion0) + eCtx.OnGetParentInfo().Return(nil) + eCtx.OnGetRawOutputDataConfig().Return(v1alpha1.RawOutputDataConfig{ RawOutputDataConfig: &admin.RawOutputDataConfig{OutputLocationPrefix: ""}, }) - eCtx.EXPECT().IncrementParallelism().Return(0) - eCtx.EXPECT().CurrentParallelism().Return(0) - eCtx.EXPECT().GetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) - eCtx.EXPECT().GetConsoleURL().Return("") + eCtx.OnIncrementParallelism().Return(0) + eCtx.OnCurrentParallelism().Return(0) + eCtx.OnGetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) + eCtx.OnGetConsoleURL().Return("") branchTakenNodeID := "branchTakenNode" branchTakenNode := &mocks.ExecutableNode{} @@ -1680,12 +1680,12 @@ func TestNodeExecutor_AbortHandler(t *testing.T) { dag.OnFromNode(id).Return(make([]string, 0), nil) execContext := mocks4.ExecutionContext{} - execContext.EXPECT().IsInterruptible().Return(false) + execContext.OnIsInterruptible().Return(false) r := v1alpha1.RawOutputDataConfig{} - execContext.EXPECT().GetRawOutputDataConfig().Return(r) - execContext.EXPECT().GetExecutionID().Return(v1alpha1.WorkflowExecutionIdentifier{}) - execContext.EXPECT().GetLabels().Return(nil) - execContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion0) + execContext.OnGetRawOutputDataConfig().Return(r) + execContext.OnGetExecutionID().Return(v1alpha1.WorkflowExecutionIdentifier{}) + execContext.OnGetLabels().Return(nil) + execContext.OnGetEventVersion().Return(v1alpha1.EventVersion0) et := &mocks.ExecutableTask{} et.OnCoreTask().Return(&core.TaskTemplate{ @@ -1697,12 +1697,12 @@ func TestNodeExecutor_AbortHandler(t *testing.T) { Version: "v", }, }) - execContext.EXPECT().GetTask("id").Return(et, nil) + execContext.OnGetTask("id").Return(et, nil) parentInfo := &mocks4.ImmutableParentInfo{} parentInfo.OnGetUniqueID().Return("someunique1") parentInfo.OnCurrentAttempt().Return(uint32(1)) parentInfo.OnIsInDynamicChain().Return(false) - execContext.EXPECT().GetParentInfo().Return(parentInfo) + execContext.OnGetParentInfo().Return(parentInfo) assert.NoError(t, nExec.AbortHandler(ctx, &execContext, &dag, nl, n, "aborting")) }) @@ -2076,12 +2076,12 @@ func TestRecover(t *testing.T) { } execContext := &mocks4.ExecutionContext{} - execContext.EXPECT().GetExecutionConfig().Return(v1alpha1.ExecutionConfig{ + execContext.OnGetExecutionConfig().Return(v1alpha1.ExecutionConfig{ RecoveryExecution: v1alpha1.WorkflowExecutionIdentifier{ WorkflowExecutionIdentifier: recoveryID, }, }) - execContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion0) + execContext.OnGetEventVersion().Return(v1alpha1.EventVersion0) nm := &nodemocks.NodeExecutionMetadata{} nm.OnGetNodeExecutionID().Return(&core.NodeExecutionIdentifier{ @@ -2513,10 +2513,10 @@ func TestIsMaxParallelismAchieved(t *testing.T) { // Creates an execution context for the test createExecContext := func(maxParallelism, currentParallelism uint32) executors.ExecutionContext { m := &mocks4.ExecutionContext{} - m.EXPECT().GetExecutionConfig().Return(v1alpha1.ExecutionConfig{ + m.OnGetExecutionConfig().Return(v1alpha1.ExecutionConfig{ MaxParallelism: maxParallelism, }) - m.EXPECT().CurrentParallelism().Return(currentParallelism) + m.OnCurrentParallelism().Return(currentParallelism) return m } diff --git a/flytepropeller/pkg/controller/nodes/gate/handler_test.go b/flytepropeller/pkg/controller/nodes/gate/handler_test.go index d988e8cb74..488cb58a07 100644 --- a/flytepropeller/pkg/controller/nodes/gate/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/gate/handler_test.go @@ -106,7 +106,7 @@ func createNodeExecutionContext(gateNode *v1alpha1.GateNodeSpec) *nodeMocks.Node dataStore, _ := storage.NewDataStore(&storage.Config{Type: storage.TypeMemory}, promutils.NewTestScope()) eCtx := &executormocks.ExecutionContext{} - eCtx.EXPECT().GetExecutionID().Return(wfExecID) + eCtx.OnGetExecutionID().Return(wfExecID) nCtx := &nodeMocks.NodeExecutionContext{} nCtx.OnNodeExecutionMetadata().Return(nm) diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/handler_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/handler_test.go index cd67b96466..bc16e648ab 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/handler_test.go @@ -112,16 +112,16 @@ func createNodeContextWithVersion(phase v1alpha1.WorkflowNodePhase, n v1alpha1.E nCtx.OnNodeStateWriter().Return(state) ex := &execMocks.ExecutionContext{} - ex.EXPECT().GetEventVersion().Return(version) - ex.EXPECT().GetParentInfo().Return(nil) - ex.EXPECT().GetName().Return("name") - ex.EXPECT().GetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) - ex.EXPECT().IncrementParallelism().Return(1) - ex.EXPECT().GetSecurityContext().Return(core.SecurityContext{}) - ex.EXPECT().GetAnnotations().Return(nil) - ex.EXPECT().GetLabels().Return(nil) - ex.EXPECT().GetRawOutputDataConfig().Return(v1alpha1.RawOutputDataConfig{}) - ex.EXPECT().GetDefinitionVersion().Return(v1alpha1.WorkflowDefinitionVersion1) + ex.OnGetEventVersion().Return(version) + ex.OnGetParentInfo().Return(nil) + ex.OnGetName().Return("name") + ex.OnGetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) + ex.OnIncrementParallelism().Return(1) + ex.OnGetSecurityContext().Return(core.SecurityContext{}) + ex.OnGetAnnotations().Return(nil) + ex.OnGetLabels().Return(nil) + ex.OnGetRawOutputDataConfig().Return(v1alpha1.RawOutputDataConfig{}) + ex.OnGetDefinitionVersion().Return(v1alpha1.WorkflowDefinitionVersion1) nCtx.OnExecutionContext().Return(ex) @@ -329,8 +329,8 @@ func TestWorkflowNodeHandler_AbortNode(t *testing.T) { ).Return(nil) eCtx := &execMocks.ExecutionContext{} - eCtx.EXPECT().GetDefinitionVersion().Return(v1alpha1.WorkflowDefinitionVersion1) - eCtx.EXPECT().GetName().Return("test") + eCtx.OnGetDefinitionVersion().Return(v1alpha1.WorkflowDefinitionVersion1) + eCtx.OnGetName().Return("test") nCtx.OnExecutionContext().Return(eCtx) err := h.Abort(ctx, nCtx, "test") assert.NoError(t, err) @@ -351,8 +351,8 @@ func TestWorkflowNodeHandler_AbortNode(t *testing.T) { ).Return(nil) eCtx := &execMocks.ExecutionContext{} - eCtx.EXPECT().GetDefinitionVersion().Return(v1alpha1.WorkflowDefinitionVersion1) - eCtx.EXPECT().GetName().Return("test") + eCtx.OnGetDefinitionVersion().Return(v1alpha1.WorkflowDefinitionVersion1) + eCtx.OnGetName().Return("test") nCtx.OnExecutionContext().Return(eCtx) err := h.Abort(ctx, nCtx, "test") assert.NoError(t, err) @@ -372,8 +372,8 @@ func TestWorkflowNodeHandler_AbortNode(t *testing.T) { nCtx := createNodeContext(v1alpha1.WorkflowNodePhaseExecuting, mockNode, mockNodeStatus) eCtx := &execMocks.ExecutionContext{} - eCtx.EXPECT().GetDefinitionVersion().Return(v1alpha1.WorkflowDefinitionVersion1) - eCtx.EXPECT().GetName().Return("test") + eCtx.OnGetDefinitionVersion().Return(v1alpha1.WorkflowDefinitionVersion1) + eCtx.OnGetName().Return("test") nCtx.OnExecutionContext().Return(eCtx) err := h.Abort(ctx, nCtx, "test") diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan_test.go index 96acf46d78..2e042d72a4 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/launchplan_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/launchplan_test.go @@ -245,19 +245,19 @@ func TestSubWorkflowHandler_StartLaunchPlan(t *testing.T) { nCtx.OnNodeExecutionMetadata().Return(nm) ectx := &execMocks.ExecutionContext{} - ectx.EXPECT().GetDefinitionVersion().Return(v1alpha1.WorkflowDefinitionVersion1) - ectx.EXPECT().GetEventVersion().Return(1) - ectx.EXPECT().GetParentInfo().Return(nil) - ectx.EXPECT().GetExecutionConfig().Return(v1alpha1.ExecutionConfig{ + ectx.OnGetDefinitionVersion().Return(v1alpha1.WorkflowDefinitionVersion1) + ectx.OnGetEventVersion().Return(1) + ectx.OnGetParentInfo().Return(nil) + ectx.OnGetExecutionConfig().Return(v1alpha1.ExecutionConfig{ RecoveryExecution: v1alpha1.WorkflowExecutionIdentifier{ WorkflowExecutionIdentifier: recoveredExecID, }, }) - ectx.EXPECT().IncrementParallelism().Return(1) - ectx.EXPECT().GetSecurityContext().Return(core.SecurityContext{}) - ectx.EXPECT().GetRawOutputDataConfig().Return(v1alpha1.RawOutputDataConfig{}) - ectx.EXPECT().GetLabels().Return(nil) - ectx.EXPECT().GetAnnotations().Return(nil) + ectx.OnIncrementParallelism().Return(1) + ectx.OnGetSecurityContext().Return(core.SecurityContext{}) + ectx.OnGetRawOutputDataConfig().Return(v1alpha1.RawOutputDataConfig{}) + ectx.OnGetLabels().Return(nil) + ectx.OnGetAnnotations().Return(nil) nCtx.OnExecutionContext().Return(ectx) nCtx.OnCurrentAttempt().Return(uint32(1)) @@ -671,7 +671,7 @@ func TestLaunchPlanHandler_HandleAbort(t *testing.T) { } nCtx := createNodeContext(v1alpha1.WorkflowNodePhaseExecuting, mockNode, mockNodeStatus) eCtx := &execMocks.ExecutionContext{} - eCtx.EXPECT().GetName().Return("name") + eCtx.OnGetName().Return("name") nCtx.OnExecutionContext().Return(eCtx) err := h.HandleAbort(ctx, nCtx, "some reason") assert.NoError(t, err) diff --git a/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow_test.go b/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow_test.go index 9fa318e7f5..df1a34cc6f 100644 --- a/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow_test.go +++ b/flytepropeller/pkg/controller/nodes/subworkflow/subworkflow_test.go @@ -30,7 +30,7 @@ func TestGetSubWorkflow(t *testing.T) { ectx := &execMocks.ExecutionContext{} swf := &coreMocks.ExecutableSubWorkflow{} - ectx.EXPECT().FindSubWorkflow("x").Return(swf) + ectx.OnFindSubWorkflow("x").Return(swf) nCtx := &mocks.NodeExecutionContext{} nCtx.OnNode().Return(node) @@ -60,7 +60,7 @@ func TestGetSubWorkflow(t *testing.T) { swf := &coreMocks.ExecutableSubWorkflow{} swf.OnGetOnFailureNode().Return(failureNode) - ectx.EXPECT().FindSubWorkflow("x").Return(swf) + ectx.OnFindSubWorkflow("x").Return(swf) nCtx := &mocks.NodeExecutionContext{} nCtx.OnNode().Return(node) @@ -82,7 +82,7 @@ func TestGetSubWorkflow(t *testing.T) { ectx := &execMocks.ExecutionContext{} - ectx.EXPECT().FindSubWorkflow("x").Return(nil) + ectx.OnFindSubWorkflow("x").Return(nil) nCtx := &mocks.NodeExecutionContext{} nCtx.OnNode().Return(node) @@ -107,7 +107,7 @@ func Test_subworkflowHandler_HandleAbort(t *testing.T) { swf := &coreMocks.ExecutableSubWorkflow{} ectx := &execMocks.ExecutionContext{} - ectx.EXPECT().FindSubWorkflow("x").Return(swf) + ectx.OnFindSubWorkflow("x").Return(swf) ns := &coreMocks.ExecutableNodeStatus{} nCtx := &mocks.NodeExecutionContext{} @@ -138,8 +138,8 @@ func Test_subworkflowHandler_HandleAbort(t *testing.T) { swf.OnStartNode().Return(&coreMocks.ExecutableNode{}) ectx := &execMocks.ExecutionContext{} - ectx.EXPECT().FindSubWorkflow("x").Return(swf) - ectx.EXPECT().GetParentInfo().Return(nil) + ectx.OnFindSubWorkflow("x").Return(swf) + ectx.OnGetParentInfo().Return(nil) ns := &coreMocks.ExecutableNodeStatus{} nCtx := &mocks.NodeExecutionContext{} @@ -172,8 +172,8 @@ func Test_subworkflowHandler_HandleAbort(t *testing.T) { swf.OnStartNode().Return(&coreMocks.ExecutableNode{}) ectx := &execMocks.ExecutionContext{} - ectx.EXPECT().FindSubWorkflow("x").Return(swf) - ectx.EXPECT().GetParentInfo().Return(nil) + ectx.OnFindSubWorkflow("x").Return(swf) + ectx.OnGetParentInfo().Return(nil) ns := &coreMocks.ExecutableNodeStatus{} nCtx := &mocks.NodeExecutionContext{} diff --git a/flytepropeller/pkg/controller/nodes/task/handler_test.go b/flytepropeller/pkg/controller/nodes/task/handler_test.go index 22e1d7451f..696b78c165 100644 --- a/flytepropeller/pkg/controller/nodes/task/handler_test.go +++ b/flytepropeller/pkg/controller/nodes/task/handler_test.go @@ -501,11 +501,11 @@ func Test_task_Handle_NoCatalog(t *testing.T) { nCtx.OnOutputShardSelector().Return(ioutils.NewConstantShardSelector([]string{"x"})) executionContext := &mocks.ExecutionContext{} - executionContext.EXPECT().GetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) - executionContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion0) - executionContext.EXPECT().GetParentInfo().Return(nil) + executionContext.OnGetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) + executionContext.OnGetEventVersion().Return(v1alpha1.EventVersion0) + executionContext.OnGetParentInfo().Return(nil) if allowIncrementParallelism { - executionContext.EXPECT().IncrementParallelism().Return(1) + executionContext.OnIncrementParallelism().Return(1) } nCtx.OnExecutionContext().Return(executionContext) @@ -814,9 +814,9 @@ func Test_task_Abort(t *testing.T) { nCtx.OnEventsRecorder().Return(ev) executionContext := &mocks.ExecutionContext{} - executionContext.EXPECT().GetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) - executionContext.EXPECT().GetParentInfo().Return(nil) - executionContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion0) + executionContext.OnGetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) + executionContext.OnGetParentInfo().Return(nil) + executionContext.OnGetEventVersion().Return(v1alpha1.EventVersion0) nCtx.OnExecutionContext().Return(executionContext) nCtx.OnRawOutputPrefix().Return("s3://sandbox/") @@ -976,9 +976,9 @@ func Test_task_Abort_v1(t *testing.T) { nCtx.OnEventsRecorder().Return(ev) executionContext := &mocks.ExecutionContext{} - executionContext.EXPECT().GetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) - executionContext.EXPECT().GetParentInfo().Return(nil) - executionContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion1) + executionContext.OnGetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) + executionContext.OnGetParentInfo().Return(nil) + executionContext.OnGetEventVersion().Return(v1alpha1.EventVersion1) nCtx.OnExecutionContext().Return(executionContext) nCtx.OnRawOutputPrefix().Return("s3://sandbox/") @@ -1158,9 +1158,9 @@ func Test_task_Finalize(t *testing.T) { nCtx.OnEnqueueOwnerFunc().Return(nil) executionContext := &mocks.ExecutionContext{} - executionContext.EXPECT().GetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) - executionContext.EXPECT().GetParentInfo().Return(nil) - executionContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion0) + executionContext.OnGetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) + executionContext.OnGetParentInfo().Return(nil) + executionContext.OnGetEventVersion().Return(v1alpha1.EventVersion0) nCtx.OnExecutionContext().Return(executionContext) nCtx.OnRawOutputPrefix().Return("s3://sandbox/") diff --git a/flytepropeller/pkg/controller/nodes/task/taskexec_context_test.go b/flytepropeller/pkg/controller/nodes/task/taskexec_context_test.go index 5f5f3d68c5..e798f82a04 100644 --- a/flytepropeller/pkg/controller/nodes/task/taskexec_context_test.go +++ b/flytepropeller/pkg/controller/nodes/task/taskexec_context_test.go @@ -93,9 +93,9 @@ func dummyNodeExecutionContext(t *testing.T, parentInfo executors.ImmutableParen nCtx.OnEnqueueOwnerFunc().Return(nil) executionContext := &mocks2.ExecutionContext{} - executionContext.EXPECT().GetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) - executionContext.EXPECT().GetParentInfo().Return(parentInfo) - executionContext.EXPECT().GetEventVersion().Return(eventVersion) + executionContext.OnGetExecutionConfig().Return(v1alpha1.ExecutionConfig{}) + executionContext.OnGetParentInfo().Return(parentInfo) + executionContext.OnGetEventVersion().Return(eventVersion) nCtx.OnExecutionContext().Return(executionContext) ds, err := storage.NewDataStore( diff --git a/flytepropeller/pkg/controller/nodes/task/transformer_test.go b/flytepropeller/pkg/controller/nodes/task/transformer_test.go index 0fdab91907..db89dda3e6 100644 --- a/flytepropeller/pkg/controller/nodes/task/transformer_test.go +++ b/flytepropeller/pkg/controller/nodes/task/transformer_test.go @@ -60,8 +60,8 @@ func TestToTaskExecutionEvent(t *testing.T) { nodeExecutionMetadata.OnIsInterruptible().Return(true) mockExecContext := &mocks2.ExecutionContext{} - mockExecContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion0) - mockExecContext.EXPECT().GetParentInfo().Return(nil) + mockExecContext.OnGetEventVersion().Return(v1alpha1.EventVersion0) + mockExecContext.OnGetParentInfo().Return(nil) tID := &pluginMocks.TaskExecutionID{} generatedName := "generated_name" @@ -252,11 +252,11 @@ func TestToTaskExecutionEventWithParent(t *testing.T) { nodeExecutionMetadata.OnIsInterruptible().Return(true) mockExecContext := &mocks2.ExecutionContext{} - mockExecContext.EXPECT().GetEventVersion().Return(v1alpha1.EventVersion1) + mockExecContext.OnGetEventVersion().Return(v1alpha1.EventVersion1) mockParentInfo := &mocks2.ImmutableParentInfo{} mockParentInfo.OnGetUniqueID().Return("np1") mockParentInfo.OnCurrentAttempt().Return(uint32(2)) - mockExecContext.EXPECT().GetParentInfo().Return(mockParentInfo) + mockExecContext.OnGetParentInfo().Return(mockParentInfo) tID := &pluginMocks.TaskExecutionID{} generatedName := "generated_name"