Skip to content

Commit 570a64e

Browse files
authored
Tests working (#481)
Signed-off-by: RemakingEden <[email protected]> Signed-off-by: RemakingEden <[email protected]>
1 parent 57c17ef commit 570a64e

File tree

4 files changed

+108
-0
lines changed

4 files changed

+108
-0
lines changed

tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/WorkflowTaskArtifacts.feature

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,14 @@ Scenario: Task with context.executions.task_id.output_dir is not triggered when
148148
| TwoTask_Context.Executions.Task_id.Output_Dir_Mandatory=True |
149149
| TwoTask_Context.Executions.Task_id.Output_Dir_Mandatory=Null |
150150

151+
@TaskArtifacts_TaskUpdate
152+
Scenario: Task is not triggered when previous task mandatory output files are missing
153+
Given I have a clinical workflow Mandatory_Output
154+
And I have a Workflow Instance Mandatory_Output with artifacts full_patient_metadata in minio
155+
When I publish a Task Update Message Mandatory_Output with no artifacts
156+
Then Workflow Instance status is Failed
157+
And I can see the status of the Task artifact_task_1 is Failed
158+
151159
@TaskArtifacts_TaskUpdate
152160
Scenario: Task with context.executions.task_id.output_dir is triggered when non mandatory files are missing
153161
Given I have a clinical workflow <testData>

tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/TaskUpdateTestData.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,11 @@ public static TaskUpdateEvent CreateTaskUpdateEvent(string workflowInstanceName)
791791
TaskUpdateEvent = CreateTaskUpdateEvent("TwoTask_Context.Executions.Task_id.Output_Dir_Mandatory=Null")
792792
},
793793
new TaskUpdateTestData()
794+
{
795+
Name = "Mandatory_Output",
796+
TaskUpdateEvent = CreateTaskUpdateEvent("Mandatory_Output")
797+
},
798+
new TaskUpdateTestData()
794799
{
795800
Name = "TwoTask_Context.Executions.Task_id.Output_Dir_Mandatory=False_No_Outputs",
796801
TaskUpdateEvent = new TaskUpdateEvent()

tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowInstanceTestData.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,6 +1346,37 @@ public static WorkflowInstance CreateWorkflowInstance(string workflowName)
13461346
WorkflowInstance = CreateWorkflowInstance("TwoTask_Context.Executions.Task_id.Output_Dir_Mandatory=Null")
13471347
},
13481348
new WorkflowInstanceTestData()
1349+
{
1350+
Name = "Mandatory_Output",
1351+
WorkflowInstance = new WorkflowInstance()
1352+
{
1353+
Id = "73dcde74-8f9c-47d2-9b91-b62c9ad2235c",
1354+
AeTitle = Helper.GetWorkflowByName("Mandatory_Output").WorkflowRevision.Workflow.InformaticsGateway.AeTitle,
1355+
WorkflowId = Helper.GetWorkflowByName("Mandatory_Output").WorkflowRevision.WorkflowId,
1356+
PayloadId = "85dce342-e5b0-4a40-9725-9a34f8e1fda0",
1357+
StartTime = DateTime.Now,
1358+
Status = Status.Created,
1359+
BucketId = TestExecutionConfig.MinioConfig.Bucket,
1360+
InputMetaData = new Dictionary<string, string>()
1361+
{
1362+
{ "", "" }
1363+
},
1364+
Tasks = new List<TaskExecution>
1365+
{
1366+
new TaskExecution()
1367+
{
1368+
ExecutionId = "77250b38-c262-4367-97b8-0094439cca94",
1369+
TaskId = Helper.GetWorkflowByName("Mandatory_Output").WorkflowRevision.Workflow.Tasks[0].Id,
1370+
TaskType = Helper.GetWorkflowByName("Mandatory_Output").WorkflowRevision?.Workflow.Tasks[0].Type,
1371+
Status = TaskExecutionStatus.Accepted,
1372+
InputArtifacts = null,
1373+
OutputArtifacts = null,
1374+
OutputDirectory = "85dce342-e5b0-4a40-9725-9a34f8e1fda0/workflows/73dcde74-8f9c-47d2-9b91-b62c9ad2235c/77250b38-c262-4367-97b8-0094439cca94"
1375+
}
1376+
}
1377+
}
1378+
},
1379+
new WorkflowInstanceTestData()
13491380
{
13501381
Name = "WorkflowInstance_TaskApi_1",
13511382
WorkflowInstance = new WorkflowInstance()

tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowRevisionTestData.cs

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2615,6 +2615,70 @@ public static class WorkflowRevisionsTestData
26152615
}
26162616
},
26172617
new WorkflowRevisionTestData()
2618+
{
2619+
Name = "Mandatory_Output",
2620+
WorkflowRevision = new WorkflowRevision()
2621+
{
2622+
Id = Guid.NewGuid().ToString(),
2623+
WorkflowId = Guid.NewGuid().ToString(),
2624+
Revision = 1,
2625+
Workflow = new Workflow()
2626+
{
2627+
Name = "Artifact 1",
2628+
Description = "Artifact 1",
2629+
Version = "1",
2630+
Tasks = new TaskObject[]
2631+
{
2632+
new TaskObject
2633+
{
2634+
Id = "artifact_task_1",
2635+
Type = "Artifact_task",
2636+
Description = "Artifact Workflow 1 Task 1",
2637+
Artifacts = new ArtifactMap()
2638+
{
2639+
Input = new Artifact[]
2640+
{
2641+
new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" },
2642+
},
2643+
Output = new Artifact[]
2644+
{
2645+
new Artifact {
2646+
Name = "output",
2647+
Mandatory = true
2648+
},
2649+
}
2650+
},
2651+
TaskDestinations = new TaskDestination[]
2652+
{
2653+
new TaskDestination{ Name = "artifact_task_2" }
2654+
}
2655+
},
2656+
new TaskObject
2657+
{
2658+
Id = "artifact_task_2",
2659+
Type = "Artifact_task",
2660+
Description = "Artifact Workflow 1 Task 2",
2661+
Artifacts = new ArtifactMap()
2662+
{
2663+
Input = new Artifact[]
2664+
{
2665+
new Artifact
2666+
{
2667+
Name = "output",
2668+
Value = "{{ context.input.dicom }}",
2669+
},
2670+
},
2671+
},
2672+
},
2673+
},
2674+
InformaticsGateway = new InformaticsGateway()
2675+
{
2676+
AeTitle = "Artifact_AE"
2677+
}
2678+
}
2679+
}
2680+
},
2681+
new WorkflowRevisionTestData()
26182682
{
26192683
Name = "Basic_Workflow_1_Deleted",
26202684
WorkflowRevision = new WorkflowRevision()

0 commit comments

Comments
 (0)