Skip to content

Commit 38f8790

Browse files
committed
Add integration tests to cover pause, resume, and cancel for task with items
Add integration tests to cover cancellation, pause, and resume of orquesta workflows that have tasks with items.
1 parent 11546b4 commit 38f8790

File tree

9 files changed

+543
-20
lines changed

9 files changed

+543
-20
lines changed

contrib/examples/actions/orquesta-test-with-items-concurrency.yaml

-10
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: orquesta-test-with-items
3+
description: A workflow for testing with items and concurrency.
4+
runner_type: orquesta
5+
entry_point: workflows/tests/orquesta-test-with-items.yaml
6+
enabled: true
7+
parameters:
8+
tempfiles:
9+
required: true
10+
type: array
11+
concurrency:
12+
type: integer

contrib/examples/actions/workflows/tests/orquesta-test-with-items-concurrency.yaml renamed to contrib/examples/actions/workflows/tests/orquesta-test-with-items.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
version: 1.0
22

3-
description: A workflow demonstrating with items and concurrent processing.
3+
description: A workflow for testing with items and concurrency.
44

55
input:
66
- tempfiles
7+
- concurrency: <% len(ctx(tempfiles)) %>
78

89
tasks:
910
task1:
1011
with:
1112
items: tempfile in <% ctx(tempfiles) %>
12-
concurrency: 2
13+
concurrency: <% ctx(concurrency) %>
1314
action: core.local
1415
input:
1516
cmd: "while [ -e '<% item(tempfile) %>' ]; do sleep 0.1; done"

contrib/runners/orquesta_runner/orquesta_runner/orquesta_runner.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def pause(self):
134134

135135
def resume(self):
136136
# Resume the target workflow.
137-
wf_svc.request_resume(self.execution)
137+
wf_ex_db = wf_svc.request_resume(self.execution)
138138

139139
# Request resume of tasks that are workflows and still running.
140140
for child_ex_id in self.execution.children:
@@ -147,7 +147,7 @@ def resume(self):
147147
)
148148

149149
return (
150-
ac_const.LIVEACTION_STATUS_RUNNING,
150+
wf_ex_db.status if wf_ex_db else ac_const.LIVEACTION_STATUS_RUNNING,
151151
self.liveaction.result,
152152
self.liveaction.context
153153
)

0 commit comments

Comments
 (0)