Skip to content

Commit 0f5472e

Browse files
Task artifact integration tests part 1 (#251)
Signed-off-by: Joe Batt <[email protected]> Co-authored-by: Joe Batt <[email protected]> Co-authored-by: Joe Batt <[email protected]>
1 parent 54a17c4 commit 0f5472e

31 files changed

+1658
-852
lines changed
Binary file not shown.

tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/PayloadCollection.feature

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,26 @@ Feature: PayloadCollection
1717
Tests around the payload collection
1818

1919
@PatientDetails
20-
Scenario: Seed MinIO with patient metadata, and payload collection has details
20+
Scenario: Payload collection will be populated with patient details after receiving a Workflow Request when patient metadata exists
2121
Given I have a clinical workflow Basic_Workflow_1
22-
And I have a bucket in MinIO bucket1
23-
And I have a payload <metadata> in the bucket bucket1 with payload id <payloadId>
24-
When I publish a Workflow Request Message <workflowRequestMessage>
22+
When I publish a Workflow Request Message <workflowRequestMessage> with artifacts <objects> in minio
2523
Then A payload collection is created with patient details <patientTestData>
26-
Then I can see <workflowInstance> Workflow Instance is created
24+
And I can see <workflowInstance> Workflow Instance is created
2725
Examples:
28-
| workflowRequestMessage | metadata | patientTestData | payloadId | workflowInstance |
29-
| Basic_AeTitle_Payload_Collection_Request_1 | full_patient_metadata | Full_Patient | 23b96697-0174-465c-b9cb-368b20a4591d | 1 |
30-
| Basic_Non_Existant_Request | partial_patient_metadata | Partial_Patient | c9c1e0f1-5994-4882-b3d4-9e1009729377 | 0 |
26+
| workflowRequestMessage | objects | patientTestData | workflowInstance |
27+
| Basic_AeTitle_Payload_Collection_Request_1 | full_patient_metadata | Full_Patient | 1 |
28+
| Basic_Non_Existant_Request | partial_patient_metadata | Partial_Patient | 0 |
3129

3230
@PatientDetails
33-
Scenario: Seed MinIO with blank patient data, and payload collection has null details
31+
Scenario: Payload collection will be populated with null patient details after receiving a Workflow Request when patient metadata is blank
3432
Given I have a clinical workflow Basic_Workflow_1
35-
And I have a bucket in MinIO bucket1
36-
And I have a payload null_patient_metadata in the bucket bucket1 with payload id 64a2b260-0379-4614-9f05-ff1279cf9e83
37-
When I publish a Workflow Request Message Basic_AeTitle_Payload_Collection_Request_2
33+
When I publish a Workflow Request Message Basic_AeTitle_Payload_Collection_Request_2 with artifacts null_patient_metadata in minio
3834
Then A payload collection is created with patient details Null_Patient
39-
Then I can see 1 Workflow Instance is created
35+
And I can see 1 Workflow Instance is created
4036

4137
@PatientDetails
42-
Scenario: Seed MinIO with no patient data, and payload collection has null details
38+
Scenario: Payload collection will be populated with null patient details after receiving a Workflow Request when patient metadata is missing
4339
Given I have a clinical workflow Basic_Workflow_1
44-
And I have a bucket in MinIO bucket1
45-
And I have a payload no_patient_metadata in the bucket bucket1 with payload id b91f5559-8ab2-455a-806d-961244ea22af
46-
When I publish a Workflow Request Message Basic_AeTitle_Payload_Collection_Request_3
40+
When I publish a Workflow Request Message Basic_AeTitle_Payload_Collection_Request_3 with artifacts no_patient_metadata in minio
4741
Then A payload collection is created with patient details Null_Patient
48-
Then I can see 1 Workflow Instance is created
42+
And I can see 1 Workflow Instance is created

tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/RouterTasks.feature

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,47 +19,41 @@ Workflow supports Router Tasks
1919
@RouterTasks
2020
Scenario: Routing Task dispatches single plug-in task
2121
Given I have a clinical workflow Routing_Workflow_Single_Destination
22-
And I have a bucket in MinIO bucket1
23-
When I publish a Workflow Request Message Routing_Workflow_Request
22+
When I publish a Workflow Request Message Routing_Workflow_Request with no artifacts
2423
Then I can see 1 Workflow Instance is created
2524
And Task Dispatch events for TaskIds taskdest1 are published
2625

2726
@RouterTasks
2827
Scenario: Routing Task dispatches multiple plug-in tasks
2928
Given I have a clinical workflow Routing_Workflow_Multi_Destination
30-
And I have a bucket in MinIO bucket1
31-
When I publish a Workflow Request Message Routing_Workflow_Request
29+
When I publish a Workflow Request Message Routing_Workflow_Request with no artifacts
3230
Then I can see 1 Workflow Instance is created
3331
And Task Dispatch events for TaskIds taskdest1, taskdest2 are published
3432

3533
@RouterTasks
3634
Scenario: Routing Task dispatches single plug-in task based on conditional statements
3735
Given I have a clinical workflow Routing_Workflow_Single_Destination_Conditional
38-
And I have a bucket in MinIO bucket1
39-
When I publish a Workflow Request Message Routing_Workflow_Request
36+
When I publish a Workflow Request Message Routing_Workflow_Request with no artifacts
4037
Then I can see 1 Workflow Instance is created
4138
And Task Dispatch events for TaskIds taskdest1 are published
4239

4340
@RouterTasks
4441
Scenario: Routing Task dispatches no tasks based on conditional statements
4542
Given I have a clinical workflow Routing_Workflow_No_Destination_Conditional
46-
And I have a bucket in MinIO bucket1
47-
When I publish a Workflow Request Message Routing_Workflow_Request
43+
When I publish a Workflow Request Message Routing_Workflow_Request with no artifacts
4844
Then I can see 1 Workflow Instance is created
4945
And A Task Dispatch event is not published
5046

5147
@RouterTasks
5248
Scenario: Routing Task dispatches additonal plugin task and triggers another router task
5349
Given I have a clinical workflow Routing_Workflow_Multi_Router
54-
And I have a bucket in MinIO bucket1
55-
When I publish a Workflow Request Message Routing_Workflow_Request
50+
When I publish a Workflow Request Message Routing_Workflow_Request with no artifacts
5651
Then I can see 1 Workflow Instance is created
5752
And Task Dispatch events for TaskIds taskdest1, taskdest2, taskdest3 are published
5853

5954
@RouterTasks
6055
Scenario: Routing Task attempts to dispatch task which does not exist in workflow
6156
Given I have a clinical workflow Routing_Workflow_Invalid_Destination
62-
And I have a bucket in MinIO bucket1
63-
When I publish a Workflow Request Message Routing_Workflow_Request
57+
When I publish a Workflow Request Message Routing_Workflow_Request with no artifacts
6458
Then I can see 1 Workflow Instance is created
6559
And A Task Dispatch event is not published

tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/TaskDestinations.feature

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ New task is dispatched after a Task update message is received.
1919
@TaskUpdate
2020
Scenario: Publish a valid Task Update event which triggers a single new task
2121
Given I have a clinical workflow Multi_Task_Workflow_3
22-
And I have a Workflow Instance WFI_Multi_Task_3
22+
And I have a Workflow Instance WFI_Multi_Task_3 with no artifacts
2323
When I publish a Task Update Message Task_Update_To_Dispatch_Single_Task with status Succeeded
2424
Then 1 Task Dispatch event is published
2525
And Workflow Instance is updated with the new Task
@@ -29,7 +29,7 @@ Scenario: Publish a valid Task Update event which triggers a single new task
2929
@TaskUpdate
3030
Scenario: Publish a valid Task Update event which triggers multiple new tasks
3131
Given I have a clinical workflow Multi_Task_Workflow_2
32-
And I have a Workflow Instance WFI_Multi_Task_2
32+
And I have a Workflow Instance WFI_Multi_Task_2 with no artifacts
3333
When I publish a Task Update Message Task_Update_Dispatches_Multi_Tasks with status Succeeded
3434
Then 2 Task Dispatch events are published
3535
And Workflow Instance is updated with the new Tasks
@@ -39,7 +39,7 @@ Scenario: Publish a valid Task Update event which triggers multiple new tasks
3939
@TaskUpdate
4040
Scenario Outline: Publish a valid Task Update event where the Task status is not created
4141
Given I have a clinical workflow Multi_Task_Workflow_1
42-
And I have a Workflow Instance <workflowInstance>
42+
And I have a Workflow Instance <workflowInstance> with no artifacts
4343
When I publish a Task Update Message Task_Update_Dispatches_Single_Task with status Succeeded
4444
Then A Task Dispatch event is not published
4545
Examples:
@@ -51,68 +51,66 @@ Scenario Outline: Publish a valid Task Update event where the Task status is not
5151
@TaskUpdate
5252
Scenario: Publish a valid Task Update event as failed which does not trigger a new task and updates the workflow status to Failed
5353
Given I have a clinical workflow Multi_Task_Workflow_1
54-
And I have a Workflow Instance WFI_Multi_Task_1
54+
And I have a Workflow Instance WFI_Multi_Task_1 with no artifacts
5555
When I publish a Task Update Message Task_Update_Dispatches_Single_Task with status Failed
5656
Then A Task Dispatch event is not published
5757
And Workflow Instance status is Failed
5858

5959
@TaskDestinationConditions
6060
Scenario: Task destination with condition true, WFI is updated with Task and task dispatch message is published
6161
Given I have a clinical workflow Multi_Task_Workflow_Destination_Single_Condition_True
62-
And I have a Workflow Instance WFI_Task_Destination_Condition_True
62+
And I have a Workflow Instance WFI_Task_Destination_Condition_True with no artifacts
6363
When I publish a Task Update Message Task_Update_Task_Destination_Condition_True with status Succeeded
6464
Then 1 Task Dispatch event is published
6565

6666
@TaskDestinationConditions
6767
Scenario: Task destination with condition false, WFI is not updated with Task and task dispatch message is not published
6868
Given I have a clinical workflow Multi_Task_Workflow_Destination_Single_Condition_False
69-
And I have a Workflow Instance WFI_Task_Destination_Condition_False
69+
And I have a Workflow Instance WFI_Task_Destination_Condition_False with no artifacts
7070
When I publish a Task Update Message Task_Update_Task_Destination_Condition_False with status Succeeded
7171
Then A Task Dispatch event is not published
7272

7373
@TaskDestinationConditions
7474
Scenario: Multiple task destinations with condition true, multiple task dispatch messages sent
7575
Given I have a clinical workflow Multi_Task_Workflow_Multiple_Destination_Single_Condition_True
76-
And I have a Workflow Instance WFI_Task_Multiple_Destination_Condition_True
76+
And I have a Workflow Instance WFI_Task_Multiple_Destination_Condition_True with no artifacts
7777
When I publish a Task Update Message Task_Update_Task_Multiple_Destination_Condition_True with status Succeeded
7878
Then 3 Task Dispatch events are published
7979

8080
@TaskDestinationConditions
8181
Scenario: Multiple task destinations with condition false, no task dispatch messages sent
8282
Given I have a clinical workflow Multi_Task_Workflow_Multiple_Destination_Single_Condition_False
83-
And I have a Workflow Instance WFI_Task_Multiple_Destination_Condition_False
83+
And I have a Workflow Instance WFI_Task_Multiple_Destination_Condition_False with no artifacts
8484
When I publish a Task Update Message Task_Update_Task_Multiple_Destination_Condition_False with status Succeeded
8585
Then A Task Dispatch event is not published
8686

8787
@TaskDestinationConditions
8888
Scenario: Multiple task destinations one with condition true and one with false, 1 task dispatch message published for task which is true
8989
Given I have a clinical workflow Multi_Task_Workflow_Destination_Multiple_Condition_True_And_False
90-
And I have a Workflow Instance WFI_Task_Destination_Condition_True_And_False
90+
And I have a Workflow Instance WFI_Task_Destination_Condition_True_And_False with no artifacts
9191
When I publish a Task Update Message Task_Update_Task_Destination_Condition_True_And_False with status Succeeded
9292
Then 1 Task Dispatch event is published
9393
And The Task Dispatch event is for Task Id b9964b10-acb4-4050-a610-374fdbe2100d
9494

9595
@TaskDestinationConditions
9696
Scenario: Workflow instance status remains created when any task status is either dispatch or accepted
9797
Given I have a clinical workflow Multi_Task_Workflow_Destination_Single_Condition_True
98-
And I have a Workflow Instance WFI_Task_Destination_Condition_True
98+
And I have a Workflow Instance WFI_Task_Destination_Condition_True with no artifacts
9999
When I publish a Task Update Message Task_Update_Task_Destination_Condition_True with status Succeeded
100100
Then 1 Task Dispatch event is published
101101
And Workflow Instance status is Created
102102

103103
@TaskDestinationConditions
104104
Scenario: Workflow instance status is failed when a condition is invalid
105105
Given I have a clinical workflow Multi_Task_Workflow_Task_Destination_Invalid_Condition
106-
And I have a Workflow Instance WFI_Task_Destination_Invalid_Condition
106+
And I have a Workflow Instance WFI_Task_Destination_Invalid_Condition with no artifacts
107107
When I publish a Task Update Message Task_Update_Task_Destination_Invalid_Condition with status Succeeded
108108
Then A Task Dispatch event is not published
109109
And Workflow Instance status is Succeeded
110110

111111
@TaskDestinationConditions
112112
Scenario: Task destination based on Dicom data conditional is successful, and task is completed and marked as succeeded
113113
Given I have a clinical workflow Workflow_Revision_for_bucket_minio
114-
And I have a Workflow Instance Workflow_instance_for_bucket_minio
115-
And I have a bucket in MinIO bucket1
116-
And I have a payload patient_1_lordge in the bucket bucket1 with payload id 5450c3a9-2b19-45b0-8b17-fb10f89d1b2d
117-
When I publish a Task Update Message Task_status_update_for_bucket_minio with status Succeeded
114+
And I have a Workflow Instance Workflow_instance_for_bucket_minio with artifacts patient_1_lordge in minio
115+
When I publish a Task Update Message Task_status_update_for_bucket_minio with artifacts patient_1_lordge in minio
118116
Then I can see the status of the Task is Succeeded

tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/TaskStatusUpdate.feature

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Update task status in the workflow instance from a Task Update Event
1919
@TaskUpdate
2020
Scenario Outline: Publish a valid Task Update event which updates the Task status
2121
Given I have a clinical workflow Task_Status_Update_Workflow
22-
And I have a Workflow Instance WFI_Task_Status_Update
22+
And I have a Workflow Instance WFI_Task_Status_Update with no artifacts
2323
When I publish a Task Update Message Task_Status_Update with status <taskUpdateStatus>
2424
Then I can see the status of the Task is updated
2525
Examples:
@@ -32,15 +32,15 @@ Scenario Outline: Publish a valid Task Update event which updates the Task statu
3232
@TaskUpdate
3333
Scenario: Publish a valid Task Update event that where WorkflowInstance does not contain TaskId
3434
Given I have a clinical workflow Task_Status_Update_Workflow
35-
And I have a Workflow Instance WFI_Task_Status_Update
36-
When I publish a Task Update Message Task_Status_Update_TaskId_Not_Found with status Succeeded
35+
And I have a Workflow Instance WFI_Task_Status_Update with no artifacts
36+
When I publish a Task Update Message Task_Status_Update_TaskId_Not_Found with status Succeeded
3737
Then I can see the status of the Task is not updated
3838

3939
@TaskUpdate
4040
Scenario Outline: Publish an invalid Task Update event which does not update the task status
4141
Given I have a clinical workflow Task_Status_Update_Workflow
42-
And I have a Workflow Instance WFI_Task_Status_Update
43-
When I publish a Task Update Message <taskUpdateMessage> with status Succeeded
42+
And I have a Workflow Instance WFI_Task_Status_Update with no artifacts
43+
When I publish a Task Update Message <taskUpdateMessage> with status Succeeded
4444
Then I can see the status of the Task is not updated
4545
Examples:
4646
| taskUpdateMessage |
@@ -51,7 +51,7 @@ Scenario Outline: Publish an invalid Task Update event which does not update the
5151

5252
@TaskUpdate
5353
Scenario Outline: Publish an valid Task Update event with a status that is invalid for current status
54-
Given I have a Workflow Instance <existingWFI>
54+
Given I have a Workflow Instance <existingWFI> with no artifacts
5555
When I publish a Task Update Message <taskUpdateMessage> with status <taskUpdateStatus>
5656
Then I can see the status of the Task is not updated
5757
Examples:

tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/WorkflowInstancesApi.feature

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ API to interact with WorkflowInstances collection
1919
@GetWorkflowInstances
2020
Scenario: Get all workflows instances - multiple
2121
Given I have an endpoint /workflowinstances
22-
And I have a Workflow Instance Existing_WFI_Created
23-
And I have a Workflow Instance Existing_WFI_Dispatched
24-
And I have a Workflow Instance WFI_Multi_Task_Dispatched
22+
And I have a Workflow Instance Existing_WFI_Created with no artifacts
23+
And I have a Workflow Instance Existing_WFI_Dispatched with no artifacts
24+
And I have a Workflow Instance WFI_Multi_Task_Dispatched with no artifacts
2525
When I send a GET request
2626
Then I will get a 200 response
2727
And I can see expected workflow instances are returned
2828

2929
@GetWorkflowInstances
3030
Scenario: Get all workflows instances - single
3131
Given I have an endpoint /workflowinstances
32-
And I have a Workflow Instance Existing_WFI_Created
32+
And I have a Workflow Instance Existing_WFI_Created with no artifacts
3333
When I send a GET request
3434
Then I will get a 200 response
3535
And I can see expected workflow instances are returned
@@ -82,22 +82,22 @@ Scenario Outline: Invalid pagination returns 400
8282
@GetWorkflowInstances
8383
Scenario: Get all workflows instances by Id
8484
Given I have an endpoint /workflowinstances/bff4cfd0-3af3-4e2b-9f3c-de2a6f2b9569
85-
And I have a Workflow Instance WFI_Static_1
86-
And I have a Workflow Instance WFI_Static_2
85+
And I have a Workflow Instance WFI_Static_1 with no artifacts
86+
And I have a Workflow Instance WFI_Static_2 with no artifacts
8787
When I send a GET request
8888
Then I will get a 200 response
8989
And I can see expected workflow instance is returned
9090

9191
@GetWorkflowInstances
9292
Scenario: Get all workflows instances by Id. Id Not Found
9393
Given I have an endpoint /workflowinstances/bff4cfd0-3af3-4e2b-9f3c-de2a6f2b9575
94-
And I have a Workflow Instance WFI_Static_1
94+
And I have a Workflow Instance WFI_Static_1 with no artifacts
9595
When I send a GET request
9696
Then I will get a 404 response
9797

9898
@GetWorkflowInstances
9999
Scenario: Get all workflows instances by Id. Id Bad Request
100100
Given I have an endpoint /workflowinstances/absfsushs
101-
And I have a Workflow Instance WFI_Static_1
101+
And I have a Workflow Instance WFI_Static_1 with no artifacts
102102
When I send a GET request
103103
Then I will get a 400 response

0 commit comments

Comments
 (0)