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 53
/
Executor.go
executable file
·141 lines (114 loc) · 4 KB
/
Executor.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
// Code generated by mockery v1.0.0. DO NOT EDIT.
package mocks
import context "context"
import core "github.com/lyft/flyteidl/gen/pb-go/flyteidl/core"
import mock "github.com/stretchr/testify/mock"
import types "github.com/lyft/flyteplugins/go/tasks/v1/types"
// Executor is an autogenerated mock type for the Executor type
type Executor struct {
mock.Mock
}
// CheckTaskStatus provides a mock function with given fields: ctx, taskCtx, task
func (_m *Executor) CheckTaskStatus(ctx context.Context, taskCtx types.TaskContext, task *core.TaskTemplate) (types.TaskStatus, error) {
ret := _m.Called(ctx, taskCtx, task)
var r0 types.TaskStatus
if rf, ok := ret.Get(0).(func(context.Context, types.TaskContext, *core.TaskTemplate) types.TaskStatus); ok {
r0 = rf(ctx, taskCtx, task)
} else {
r0 = ret.Get(0).(types.TaskStatus)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.TaskContext, *core.TaskTemplate) error); ok {
r1 = rf(ctx, taskCtx, task)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetID provides a mock function with given fields:
func (_m *Executor) GetID() 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
}
// GetProperties provides a mock function with given fields:
func (_m *Executor) GetProperties() types.ExecutorProperties {
ret := _m.Called()
var r0 types.ExecutorProperties
if rf, ok := ret.Get(0).(func() types.ExecutorProperties); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(types.ExecutorProperties)
}
return r0
}
// Initialize provides a mock function with given fields: ctx, param
func (_m *Executor) Initialize(ctx context.Context, param types.ExecutorInitializationParameters) error {
ret := _m.Called(ctx, param)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, types.ExecutorInitializationParameters) error); ok {
r0 = rf(ctx, param)
} else {
r0 = ret.Error(0)
}
return r0
}
// KillTask provides a mock function with given fields: ctx, taskCtx, reason
func (_m *Executor) KillTask(ctx context.Context, taskCtx types.TaskContext, reason string) error {
ret := _m.Called(ctx, taskCtx, reason)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, types.TaskContext, string) error); ok {
r0 = rf(ctx, taskCtx, reason)
} else {
r0 = ret.Error(0)
}
return r0
}
// ResolveOutputs provides a mock function with given fields: ctx, taskCtx, outputVariables
func (_m *Executor) ResolveOutputs(ctx context.Context, taskCtx types.TaskContext, outputVariables ...string) (map[string]*core.Literal, error) {
_va := make([]interface{}, len(outputVariables))
for _i := range outputVariables {
_va[_i] = outputVariables[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx, taskCtx)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 map[string]*core.Literal
if rf, ok := ret.Get(0).(func(context.Context, types.TaskContext, ...string) map[string]*core.Literal); ok {
r0 = rf(ctx, taskCtx, outputVariables...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[string]*core.Literal)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.TaskContext, ...string) error); ok {
r1 = rf(ctx, taskCtx, outputVariables...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// StartTask provides a mock function with given fields: ctx, taskCtx, task, inputs
func (_m *Executor) StartTask(ctx context.Context, taskCtx types.TaskContext, task *core.TaskTemplate, inputs *core.LiteralMap) (types.TaskStatus, error) {
ret := _m.Called(ctx, taskCtx, task, inputs)
var r0 types.TaskStatus
if rf, ok := ret.Get(0).(func(context.Context, types.TaskContext, *core.TaskTemplate, *core.LiteralMap) types.TaskStatus); ok {
r0 = rf(ctx, taskCtx, task, inputs)
} else {
r0 = ret.Get(0).(types.TaskStatus)
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, types.TaskContext, *core.TaskTemplate, *core.LiteralMap) error); ok {
r1 = rf(ctx, taskCtx, task, inputs)
} else {
r1 = ret.Error(1)
}
return r0, r1
}