From 603ba083c329b5ecfe45402b8b72c2ef7469cf1f Mon Sep 17 00:00:00 2001 From: isubasinghe Date: Thu, 2 Jan 2025 14:08:58 +1100 Subject: [PATCH] fix: address failing unit tests Signed-off-by: isubasinghe --- workflow/controller/dag.go | 1 + workflow/controller/dag_test.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/workflow/controller/dag.go b/workflow/controller/dag.go index fbcbd8613f05..e4fc60d40dc5 100644 --- a/workflow/controller/dag.go +++ b/workflow/controller/dag.go @@ -254,6 +254,7 @@ func (woc *wfOperationCtx) executeDAG(ctx context.Context, nodeName string, tmpl onExitTemplate: opts.onExitTemplate, dependencies: make(map[string][]string), dependsLogic: make(map[string]string), + log: woc.log, } // Identify our target tasks. If user did not specify any, then we choose all tasks which have diff --git a/workflow/controller/dag_test.go b/workflow/controller/dag_test.go index 082c7c8394ff..9a377ba2b37d 100644 --- a/workflow/controller/dag_test.go +++ b/workflow/controller/dag_test.go @@ -12,6 +12,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1" + "github.com/argoproj/argo-workflows/v3/util/logging" "github.com/argoproj/argo-workflows/v3/workflow/common" ) @@ -245,6 +246,7 @@ func TestEvaluateDependsLogic(t *testing.T) { wf: &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Name: "test-wf"}}, dependencies: make(map[string][]string), dependsLogic: make(map[string]string), + log: logging.NewSlogLogger(), } // Task A is running @@ -346,6 +348,7 @@ func TestEvaluateAnyAllDependsLogic(t *testing.T) { wf: &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Name: "test-wf"}}, dependencies: make(map[string][]string), dependsLogic: make(map[string]string), + log: logging.NewSlogLogger(), } // Task A is still running, A-1 succeeded but A-2 failed @@ -433,6 +436,7 @@ func TestEvaluateDependsLogicWhenDaemonFailed(t *testing.T) { wf: &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Name: "test-wf"}}, dependencies: make(map[string][]string), dependsLogic: make(map[string]string), + log: logging.NewSlogLogger(), } // Task A is running @@ -483,6 +487,7 @@ func TestEvaluateDependsLogicWhenTaskOmitted(t *testing.T) { wf: &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Name: "test-wf"}}, dependencies: make(map[string][]string), dependsLogic: make(map[string]string), + log: logging.NewSlogLogger(), } // Task A is running @@ -531,6 +536,7 @@ func TestAllEvaluateDependsLogic(t *testing.T) { wf: &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Name: "test-wf"}}, dependencies: make(map[string][]string), dependsLogic: make(map[string]string), + log: logging.NewSlogLogger(), } // Task A is running