Skip to content

Commit

Permalink
fix: address failing unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: isubasinghe <[email protected]>
  • Loading branch information
isubasinghe committed Jan 2, 2025
1 parent 05056ef commit 603ba08
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions workflow/controller/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions workflow/controller/dag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 603ba08

Please sign in to comment.