diff --git a/workflow/executor.go b/workflow/executor.go index 67cbac70..d5029ce3 100644 --- a/workflow/executor.go +++ b/workflow/executor.go @@ -110,7 +110,7 @@ func (e *executor) Prepare(workflow *Workflow, workflowContext map[string][]byte return nil, err } - dataModel, err := getDatModel(runnableSteps, stepLifecycles) + dataModel, err := getStepDatModel(runnableSteps, stepLifecycles) if err != nil { return nil, err } @@ -397,16 +397,14 @@ func (e *executor) verifyStageInputs( return nil } -func getDatModel( +func getStepDatModel( runnableSteps map[string]step.RunnableStep, stepLifecycles map[string]step.Lifecycle[step.LifecycleStageWithSchema]) (map[string]any, error) { - var i interface{} dataModel := map[string]any{ - WorkflowInputKey: i, + WorkflowInputKey: nil, WorkflowStepsKey: map[string]any{}} for stepID, _ := range runnableSteps { - //stepID := stepID stepDataModel := map[string]any{} for _, stage := range stepLifecycles[stepID].Stages { steps := dataModel[WorkflowStepsKey].(map[string]any) diff --git a/workflow/executor_test.go b/workflow/executor_test.go index 6098af31..0a13b77c 100644 --- a/workflow/executor_test.go +++ b/workflow/executor_test.go @@ -260,7 +260,7 @@ steps: wait_time_ms: 0 # invalid wait for specification # specifically, deploy does not have any outputs - wait_for: !expr $.steps.wait_1.deploy + wait_for: !expr $.steps.wait_1.starting outputs: a: b: !expr $.steps.wait_2.outputs @@ -273,9 +273,5 @@ func TestDependOnNoOutputs(t *testing.T) { // - wait_1 = {}; not having a property named 'deploy', // - wait_1 = { deploy: nil }; the 'deploy' property has no outputs (i.e. nil output) _, err := getTestImplPreparedWorkflow(t, invalidWaitfor) - assert.NoError(t, err) - //outputID, outputData, err := wf.Execute(context.Background(), map[any]any{}) - //assert.Error(t, err) - //fmt.Printf("output id: %s\noutput: %v\n", outputID, outputData) - //assert.Contains(t, err.Error(), "object wait_1 does not have a property named deploy") + assert.Error(t, err) }