@@ -70,12 +70,13 @@ describe('ExecutionService', () => {
70
70
/**
71
71
* Arrange
72
72
*/
73
- executionRepository . findSingleExecution . mockResolvedValue ( undefined ) ;
73
+ executionRepository . findWithUnflattenedData . mockResolvedValue ( undefined ) ;
74
+ const req = mock < ExecutionRequest . Stop > ( { params : { id : '1234' } } ) ;
74
75
75
76
/**
76
77
* Act
77
78
*/
78
- const stop = executionService . stop ( 'inexistent-123' ) ;
79
+ const stop = executionService . stop ( req . params . id , [ ] ) ;
79
80
80
81
/**
81
82
* Assert
@@ -88,12 +89,13 @@ describe('ExecutionService', () => {
88
89
* Arrange
89
90
*/
90
91
const execution = mock < IExecutionResponse > ( { id : '123' , status : 'success' } ) ;
91
- executionRepository . findSingleExecution . mockResolvedValue ( execution ) ;
92
+ executionRepository . findWithUnflattenedData . mockResolvedValue ( execution ) ;
93
+ const req = mock < ExecutionRequest . Stop > ( { params : { id : execution . id } } ) ;
92
94
93
95
/**
94
96
* Act
95
97
*/
96
- const stop = executionService . stop ( execution . id ) ;
98
+ const stop = executionService . stop ( req . params . id , [ execution . id ] ) ;
97
99
98
100
/**
99
101
* Assert
@@ -107,16 +109,18 @@ describe('ExecutionService', () => {
107
109
* Arrange
108
110
*/
109
111
const execution = mock < IExecutionResponse > ( { id : '123' , status : 'running' } ) ;
110
- executionRepository . findSingleExecution . mockResolvedValue ( execution ) ;
112
+ executionRepository . findWithUnflattenedData . mockResolvedValue ( execution ) ;
111
113
concurrencyControl . has . mockReturnValue ( false ) ;
112
114
activeExecutions . has . mockReturnValue ( true ) ;
113
115
waitTracker . has . mockReturnValue ( false ) ;
114
116
executionRepository . stopDuringRun . mockResolvedValue ( mock < IExecutionResponse > ( ) ) ;
115
117
118
+ const req = mock < ExecutionRequest . Stop > ( { params : { id : execution . id } } ) ;
119
+
116
120
/**
117
121
* Act
118
122
*/
119
- await executionService . stop ( execution . id ) ;
123
+ await executionService . stop ( req . params . id , [ execution . id ] ) ;
120
124
121
125
/**
122
126
* Assert
@@ -132,16 +136,18 @@ describe('ExecutionService', () => {
132
136
* Arrange
133
137
*/
134
138
const execution = mock < IExecutionResponse > ( { id : '123' , status : 'waiting' } ) ;
135
- executionRepository . findSingleExecution . mockResolvedValue ( execution ) ;
139
+ executionRepository . findWithUnflattenedData . mockResolvedValue ( execution ) ;
136
140
concurrencyControl . has . mockReturnValue ( false ) ;
137
141
activeExecutions . has . mockReturnValue ( true ) ;
138
142
waitTracker . has . mockReturnValue ( true ) ;
139
143
executionRepository . stopDuringRun . mockResolvedValue ( mock < IExecutionResponse > ( ) ) ;
140
144
145
+ const req = mock < ExecutionRequest . Stop > ( { params : { id : execution . id } } ) ;
146
+
141
147
/**
142
148
* Act
143
149
*/
144
- await executionService . stop ( execution . id ) ;
150
+ await executionService . stop ( req . params . id , [ execution . id ] ) ;
145
151
146
152
/**
147
153
* Assert
@@ -157,16 +163,18 @@ describe('ExecutionService', () => {
157
163
* Arrange
158
164
*/
159
165
const execution = mock < IExecutionResponse > ( { id : '123' , status : 'new' , mode : 'trigger' } ) ;
160
- executionRepository . findSingleExecution . mockResolvedValue ( execution ) ;
166
+ executionRepository . findWithUnflattenedData . mockResolvedValue ( execution ) ;
161
167
concurrencyControl . has . mockReturnValue ( true ) ;
162
168
activeExecutions . has . mockReturnValue ( false ) ;
163
169
waitTracker . has . mockReturnValue ( false ) ;
164
170
executionRepository . stopBeforeRun . mockResolvedValue ( mock < IExecutionResponse > ( ) ) ;
165
171
172
+ const req = mock < ExecutionRequest . Stop > ( { params : { id : execution . id } } ) ;
173
+
166
174
/**
167
175
* Act
168
176
*/
169
- await executionService . stop ( execution . id ) ;
177
+ await executionService . stop ( req . params . id , [ execution . id ] ) ;
170
178
171
179
/**
172
180
* Assert
@@ -193,11 +201,13 @@ describe('ExecutionService', () => {
193
201
mode : 'manual' ,
194
202
status : 'running' ,
195
203
} ) ;
196
- executionRepository . findSingleExecution . mockResolvedValue ( execution ) ;
204
+ executionRepository . findWithUnflattenedData . mockResolvedValue ( execution ) ;
197
205
concurrencyControl . has . mockReturnValue ( false ) ;
198
206
activeExecutions . has . mockReturnValue ( true ) ;
199
207
waitTracker . has . mockReturnValue ( false ) ;
200
- const job = mock < Job > ( { data : { executionId : '123' } } ) ;
208
+
209
+ const req = mock < ExecutionRequest . Stop > ( { params : { id : execution . id } } ) ;
210
+ const job = mock < Job > ( { data : { executionId : execution . id } } ) ;
201
211
scalingService . findJobsByStatus . mockResolvedValue ( [ job ] ) ;
202
212
executionRepository . stopDuringRun . mockResolvedValue ( mock < IExecutionResponse > ( ) ) ;
203
213
// @ts -expect-error Private method
@@ -206,7 +216,7 @@ describe('ExecutionService', () => {
206
216
/**
207
217
* Act
208
218
*/
209
- await executionService . stop ( execution . id ) ;
219
+ await executionService . stop ( req . params . id , [ execution . id ] ) ;
210
220
211
221
/**
212
222
* Assert
@@ -228,16 +238,18 @@ describe('ExecutionService', () => {
228
238
*/
229
239
config . set ( 'executions.mode' , 'queue' ) ;
230
240
const execution = mock < IExecutionResponse > ( { id : '123' , status : 'running' } ) ;
231
- executionRepository . findSingleExecution . mockResolvedValue ( execution ) ;
241
+ executionRepository . findWithUnflattenedData . mockResolvedValue ( execution ) ;
232
242
waitTracker . has . mockReturnValue ( false ) ;
233
- const job = mock < Job > ( { data : { executionId : '123' } } ) ;
243
+
244
+ const req = mock < ExecutionRequest . Stop > ( { params : { id : execution . id } } ) ;
245
+ const job = mock < Job > ( { data : { executionId : execution . id } } ) ;
234
246
scalingService . findJobsByStatus . mockResolvedValue ( [ job ] ) ;
235
247
executionRepository . stopDuringRun . mockResolvedValue ( mock < IExecutionResponse > ( ) ) ;
236
248
237
249
/**
238
250
* Act
239
251
*/
240
- await executionService . stop ( execution . id ) ;
252
+ await executionService . stop ( req . params . id , [ execution . id ] ) ;
241
253
242
254
/**
243
255
* Assert
@@ -255,16 +267,18 @@ describe('ExecutionService', () => {
255
267
*/
256
268
config . set ( 'executions.mode' , 'queue' ) ;
257
269
const execution = mock < IExecutionResponse > ( { id : '123' , status : 'waiting' } ) ;
258
- executionRepository . findSingleExecution . mockResolvedValue ( execution ) ;
270
+ executionRepository . findWithUnflattenedData . mockResolvedValue ( execution ) ;
259
271
waitTracker . has . mockReturnValue ( true ) ;
260
- const job = mock < Job > ( { data : { executionId : '123' } } ) ;
272
+
273
+ const req = mock < ExecutionRequest . Stop > ( { params : { id : execution . id } } ) ;
274
+ const job = mock < Job > ( { data : { executionId : execution . id } } ) ;
261
275
scalingService . findJobsByStatus . mockResolvedValue ( [ job ] ) ;
262
276
executionRepository . stopDuringRun . mockResolvedValue ( mock < IExecutionResponse > ( ) ) ;
263
277
264
278
/**
265
279
* Act
266
280
*/
267
- await executionService . stop ( execution . id ) ;
281
+ await executionService . stop ( req . params . id , [ execution . id ] ) ;
268
282
269
283
/**
270
284
* Assert
0 commit comments