This repository has been archived by the owner on Oct 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
/
task_node_handler.go
239 lines (185 loc) · 8.29 KB
/
task_node_handler.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
// Code generated by mockery v1.0.1. DO NOT EDIT.
package mocks
import (
context "context"
catalog "github.com/flyteorg/flyteplugins/go/tasks/pluginmachinery/catalog"
handler "github.com/flyteorg/flytepropeller/pkg/controller/nodes/handler"
io "github.com/flyteorg/flyteplugins/go/tasks/pluginmachinery/io"
ioutils "github.com/flyteorg/flyteplugins/go/tasks/pluginmachinery/ioutils"
mock "github.com/stretchr/testify/mock"
v1alpha1 "github.com/flyteorg/flytepropeller/pkg/apis/flyteworkflow/v1alpha1"
)
// TaskNodeHandler is an autogenerated mock type for the TaskNodeHandler type
type TaskNodeHandler struct {
mock.Mock
}
type TaskNodeHandler_Abort struct {
*mock.Call
}
func (_m TaskNodeHandler_Abort) Return(_a0 error) *TaskNodeHandler_Abort {
return &TaskNodeHandler_Abort{Call: _m.Call.Return(_a0)}
}
func (_m *TaskNodeHandler) OnAbort(ctx context.Context, executionContext handler.NodeExecutionContext, reason string) *TaskNodeHandler_Abort {
c_call := _m.On("Abort", ctx, executionContext, reason)
return &TaskNodeHandler_Abort{Call: c_call}
}
func (_m *TaskNodeHandler) OnAbortMatch(matchers ...interface{}) *TaskNodeHandler_Abort {
c_call := _m.On("Abort", matchers...)
return &TaskNodeHandler_Abort{Call: c_call}
}
// Abort provides a mock function with given fields: ctx, executionContext, reason
func (_m *TaskNodeHandler) Abort(ctx context.Context, executionContext handler.NodeExecutionContext, reason string) error {
ret := _m.Called(ctx, executionContext, reason)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, handler.NodeExecutionContext, string) error); ok {
r0 = rf(ctx, executionContext, reason)
} else {
r0 = ret.Error(0)
}
return r0
}
type TaskNodeHandler_Finalize struct {
*mock.Call
}
func (_m TaskNodeHandler_Finalize) Return(_a0 error) *TaskNodeHandler_Finalize {
return &TaskNodeHandler_Finalize{Call: _m.Call.Return(_a0)}
}
func (_m *TaskNodeHandler) OnFinalize(ctx context.Context, executionContext handler.NodeExecutionContext) *TaskNodeHandler_Finalize {
c_call := _m.On("Finalize", ctx, executionContext)
return &TaskNodeHandler_Finalize{Call: c_call}
}
func (_m *TaskNodeHandler) OnFinalizeMatch(matchers ...interface{}) *TaskNodeHandler_Finalize {
c_call := _m.On("Finalize", matchers...)
return &TaskNodeHandler_Finalize{Call: c_call}
}
// Finalize provides a mock function with given fields: ctx, executionContext
func (_m *TaskNodeHandler) Finalize(ctx context.Context, executionContext handler.NodeExecutionContext) error {
ret := _m.Called(ctx, executionContext)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, handler.NodeExecutionContext) error); ok {
r0 = rf(ctx, executionContext)
} else {
r0 = ret.Error(0)
}
return r0
}
type TaskNodeHandler_FinalizeRequired struct {
*mock.Call
}
func (_m TaskNodeHandler_FinalizeRequired) Return(_a0 bool) *TaskNodeHandler_FinalizeRequired {
return &TaskNodeHandler_FinalizeRequired{Call: _m.Call.Return(_a0)}
}
func (_m *TaskNodeHandler) OnFinalizeRequired() *TaskNodeHandler_FinalizeRequired {
c_call := _m.On("FinalizeRequired")
return &TaskNodeHandler_FinalizeRequired{Call: c_call}
}
func (_m *TaskNodeHandler) OnFinalizeRequiredMatch(matchers ...interface{}) *TaskNodeHandler_FinalizeRequired {
c_call := _m.On("FinalizeRequired", matchers...)
return &TaskNodeHandler_FinalizeRequired{Call: c_call}
}
// FinalizeRequired provides a mock function with given fields:
func (_m *TaskNodeHandler) FinalizeRequired() bool {
ret := _m.Called()
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
type TaskNodeHandler_Handle struct {
*mock.Call
}
func (_m TaskNodeHandler_Handle) Return(_a0 handler.Transition, _a1 error) *TaskNodeHandler_Handle {
return &TaskNodeHandler_Handle{Call: _m.Call.Return(_a0, _a1)}
}
func (_m *TaskNodeHandler) OnHandle(ctx context.Context, executionContext handler.NodeExecutionContext) *TaskNodeHandler_Handle {
c_call := _m.On("Handle", ctx, executionContext)
return &TaskNodeHandler_Handle{Call: c_call}
}
func (_m *TaskNodeHandler) OnHandleMatch(matchers ...interface{}) *TaskNodeHandler_Handle {
c_call := _m.On("Handle", matchers...)
return &TaskNodeHandler_Handle{Call: c_call}
}
// Handle provides a mock function with given fields: ctx, executionContext
func (_m *TaskNodeHandler) Handle(ctx context.Context, executionContext handler.NodeExecutionContext) (handler.Transition, error) {
ret := _m.Called(ctx, executionContext)
var r0 handler.Transition
if rf, ok := ret.Get(0).(func(context.Context, handler.NodeExecutionContext) handler.Transition); ok {
r0 = rf(ctx, executionContext)
} else {
r0 = ret.Get(0).(handler.Transition)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, handler.NodeExecutionContext) error); ok {
r1 = rf(ctx, executionContext)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
type TaskNodeHandler_Setup struct {
*mock.Call
}
func (_m TaskNodeHandler_Setup) Return(_a0 error) *TaskNodeHandler_Setup {
return &TaskNodeHandler_Setup{Call: _m.Call.Return(_a0)}
}
func (_m *TaskNodeHandler) OnSetup(ctx context.Context, setupContext handler.SetupContext) *TaskNodeHandler_Setup {
c_call := _m.On("Setup", ctx, setupContext)
return &TaskNodeHandler_Setup{Call: c_call}
}
func (_m *TaskNodeHandler) OnSetupMatch(matchers ...interface{}) *TaskNodeHandler_Setup {
c_call := _m.On("Setup", matchers...)
return &TaskNodeHandler_Setup{Call: c_call}
}
// Setup provides a mock function with given fields: ctx, setupContext
func (_m *TaskNodeHandler) Setup(ctx context.Context, setupContext handler.SetupContext) error {
ret := _m.Called(ctx, setupContext)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, handler.SetupContext) error); ok {
r0 = rf(ctx, setupContext)
} else {
r0 = ret.Error(0)
}
return r0
}
type TaskNodeHandler_ValidateOutputAndCacheAdd struct {
*mock.Call
}
func (_m TaskNodeHandler_ValidateOutputAndCacheAdd) Return(_a0 catalog.Status, _a1 *io.ExecutionError, _a2 error) *TaskNodeHandler_ValidateOutputAndCacheAdd {
return &TaskNodeHandler_ValidateOutputAndCacheAdd{Call: _m.Call.Return(_a0, _a1, _a2)}
}
func (_m *TaskNodeHandler) OnValidateOutputAndCacheAdd(ctx context.Context, nodeID string, i io.InputReader, r io.OutputReader, outputCommitter io.OutputWriter, executionConfig v1alpha1.ExecutionConfig, tr ioutils.SimpleTaskReader, m catalog.Metadata) *TaskNodeHandler_ValidateOutputAndCacheAdd {
c_call := _m.On("ValidateOutputAndCacheAdd", ctx, nodeID, i, r, outputCommitter, executionConfig, tr, m)
return &TaskNodeHandler_ValidateOutputAndCacheAdd{Call: c_call}
}
func (_m *TaskNodeHandler) OnValidateOutputAndCacheAddMatch(matchers ...interface{}) *TaskNodeHandler_ValidateOutputAndCacheAdd {
c_call := _m.On("ValidateOutputAndCacheAdd", matchers...)
return &TaskNodeHandler_ValidateOutputAndCacheAdd{Call: c_call}
}
// ValidateOutputAndCacheAdd provides a mock function with given fields: ctx, nodeID, i, r, outputCommitter, executionConfig, tr, m
func (_m *TaskNodeHandler) ValidateOutputAndCacheAdd(ctx context.Context, nodeID string, i io.InputReader, r io.OutputReader, outputCommitter io.OutputWriter, executionConfig v1alpha1.ExecutionConfig, tr ioutils.SimpleTaskReader, m catalog.Metadata) (catalog.Status, *io.ExecutionError, error) {
ret := _m.Called(ctx, nodeID, i, r, outputCommitter, executionConfig, tr, m)
var r0 catalog.Status
if rf, ok := ret.Get(0).(func(context.Context, string, io.InputReader, io.OutputReader, io.OutputWriter, v1alpha1.ExecutionConfig, ioutils.SimpleTaskReader, catalog.Metadata) catalog.Status); ok {
r0 = rf(ctx, nodeID, i, r, outputCommitter, executionConfig, tr, m)
} else {
r0 = ret.Get(0).(catalog.Status)
}
var r1 *io.ExecutionError
if rf, ok := ret.Get(1).(func(context.Context, string, io.InputReader, io.OutputReader, io.OutputWriter, v1alpha1.ExecutionConfig, ioutils.SimpleTaskReader, catalog.Metadata) *io.ExecutionError); ok {
r1 = rf(ctx, nodeID, i, r, outputCommitter, executionConfig, tr, m)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*io.ExecutionError)
}
}
var r2 error
if rf, ok := ret.Get(2).(func(context.Context, string, io.InputReader, io.OutputReader, io.OutputWriter, v1alpha1.ExecutionConfig, ioutils.SimpleTaskReader, catalog.Metadata) error); ok {
r2 = rf(ctx, nodeID, i, r, outputCommitter, executionConfig, tr, m)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}