From c95a1599402aebe08da807186cf74ea5eb0a0be6 Mon Sep 17 00:00:00 2001 From: Daniel Rammer Date: Mon, 14 Oct 2024 13:15:37 -0500 Subject: [PATCH] fixed unit tests Signed-off-by: Daniel Rammer --- .../nodes/dynamic/dynamic_workflow_test.go | 17 ++++++++++++++++- .../pkg/controller/nodes/resolve_test.go | 4 ++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go b/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go index 389ea0439b..5f329ea18f 100644 --- a/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go +++ b/flytepropeller/pkg/controller/nodes/dynamic/dynamic_workflow_test.go @@ -179,6 +179,9 @@ func Test_dynamicNodeHandler_buildContextualDynamicWorkflow_withLaunchPlans(t *t }, }, }, + Spec: &admin.LaunchPlanSpec{ + FixedInputs: &core.LiteralMap{}, + }, }, nil) h := &mocks6.TaskNodeHandler{} n := &mocks.Node{} @@ -251,6 +254,9 @@ func Test_dynamicNodeHandler_buildContextualDynamicWorkflow_withLaunchPlans(t *t }, }, }, + Spec: &admin.LaunchPlanSpec{ + FixedInputs: &core.LiteralMap{}, + }, }, nil) h := &mocks6.TaskNodeHandler{} n := &mocks.Node{} @@ -320,6 +326,9 @@ func Test_dynamicNodeHandler_buildContextualDynamicWorkflow_withLaunchPlans(t *t }, }, }, + Spec: &admin.LaunchPlanSpec{ + FixedInputs: &core.LiteralMap{}, + }, }, nil) h := &mocks6.TaskNodeHandler{} n := &mocks.Node{} @@ -403,6 +412,9 @@ func Test_dynamicNodeHandler_buildContextualDynamicWorkflow_withLaunchPlans(t *t }, }, }, + Spec: &admin.LaunchPlanSpec{ + FixedInputs: &core.LiteralMap{}, + }, }, nil) h := &mocks6.TaskNodeHandler{} n := &mocks.Node{} @@ -496,7 +508,7 @@ func Test_dynamicNodeHandler_buildContextualDynamicWorkflow_withLaunchPlans(t *t composedPBStore.OnWriteRawMatch( mock.MatchedBy(func(ctx context.Context) bool { return true }), storage.DataReference("s3://my-s3-bucket/foo/bar/futures_compiled.pb"), - int64(1501), + int64(1892), storage.Options{}, mock.MatchedBy(func(rdr *bytes.Reader) bool { return true })).Return(errors.New("foo")) @@ -545,6 +557,9 @@ func Test_dynamicNodeHandler_buildContextualDynamicWorkflow_withLaunchPlans(t *t }, }, }, + Spec: &admin.LaunchPlanSpec{ + FixedInputs: &core.LiteralMap{}, + }, }, nil) h := &mocks6.TaskNodeHandler{} diff --git a/flytepropeller/pkg/controller/nodes/resolve_test.go b/flytepropeller/pkg/controller/nodes/resolve_test.go index 10b9e4e45d..f6446f396e 100644 --- a/flytepropeller/pkg/controller/nodes/resolve_test.go +++ b/flytepropeller/pkg/controller/nodes/resolve_test.go @@ -134,6 +134,10 @@ func (d *dummyBaseWorkflow) FindSubWorkflow(subID v1alpha1.WorkflowID) v1alpha1. return nil } +func (d *dummyBaseWorkflow) FindLaunchPlan(refID v1alpha1.LaunchPlanRefID) v1alpha1.ExecutableLaunchPlan { + return nil +} + func (d *dummyBaseWorkflow) GetExecutionStatus() v1alpha1.ExecutableWorkflowStatus { return nil }