From a76d1f94d25a98c89743215ba967cefb4c26ee7e Mon Sep 17 00:00:00 2001 From: Miguel Prieto Date: Fri, 3 Jan 2025 01:20:21 -0300 Subject: [PATCH] Fix unit test. These tests shouldn't require a workflow executor connected to a Conductor instance. --- test/unit_tests/workflow_def_test.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/unit_tests/workflow_def_test.go b/test/unit_tests/workflow_def_test.go index a99110be..ab1d8c11 100644 --- a/test/unit_tests/workflow_def_test.go +++ b/test/unit_tests/workflow_def_test.go @@ -8,7 +8,7 @@ import ( "github.com/conductor-sdk/conductor-go/sdk/model" "github.com/conductor-sdk/conductor-go/sdk/workflow" - "github.com/conductor-sdk/conductor-go/test/testdata" + "github.com/stretchr/testify/assert" ) @@ -17,7 +17,7 @@ func TestRetrySettings(t *testing.T) { simpleTask.RetryPolicy(2, workflow.FixedRetry, 10, 1) simpleTask.Input("url", "${workflow.input.url}") simpleTask.CacheConfig("${url}", 120) - wf := workflow.NewConductorWorkflow(testdata.WorkflowExecutor). + wf := workflow.NewConductorWorkflow(nil). Name("workflow_with_task_retries"). Version(1). Add(simpleTask) @@ -41,7 +41,7 @@ func TestHttpTask(t *testing.T) { httpTask.RetryPolicy(2, workflow.FixedRetry, 10, 1) httpTask.Input("url", "${workflow.input.url}") httpTask.CacheConfig("${url}", 120) - wf := workflow.NewConductorWorkflow(testdata.WorkflowExecutor). + wf := workflow.NewConductorWorkflow(nil). Name("workflow_with_http_task_retries"). Version(1). Add(httpTask) @@ -62,7 +62,7 @@ func TestUpdateTaskWithTaskId(t *testing.T) { updateTask.MergeOutput(true) updateTask.TaskOutput(map[string]interface{}{"key": map[string]interface{}{"nestedKey": "nestedValue"}}) - wf := workflow.NewConductorWorkflow(testdata.WorkflowExecutor). + wf := workflow.NewConductorWorkflow(nil). Name("workflow_with_update_task"). Version(1). Add(updateTask) @@ -82,12 +82,11 @@ func TestUpdateTaskWithTaskId(t *testing.T) { } func TestUpdateTaskWithWorkflowIdAndTaskRef(t *testing.T) { - updateTask := workflow.NewUpdateTask("update_task_ref", model.CompletedTask, "target_workflow", "target_task_ref") updateTask.MergeOutput(true) integers := []int{2, 3, 5, 7, 11, 13} updateTask.TaskOutput(map[string]interface{}{"key": integers}) - wf := workflow.NewConductorWorkflow(testdata.WorkflowExecutor). + wf := workflow.NewConductorWorkflow(nil). Name("workflow_with_update_task"). Version(1). Add(updateTask)