Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: test parameterKey can update an array #172

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions pkg/hooks/data_passing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,27 @@ func TestInput(t *testing.T) {
r.NoError(err)
r.Equal(s, `99
`)

// test array value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔Is this PR only for adding test cases?

paramValue, err = wfCtx.MakeParameter(`parameter: {myscore: ["test"]}`)
r.NoError(err)
err = Input(wfCtx, paramValue, v1alpha1.WorkflowStep{
WorkflowStepBase: v1alpha1.WorkflowStepBase{
DependsOn: []string{"mystep"},
Inputs: v1alpha1.StepInputs{{
From: "foo.score",
ParameterKey: "myscore[0]",
}},
},
})
r.NoError(err)
result, err = paramValue.LookupValue("parameter", "myscore")
r.NoError(err)
s, err = result.String()
r.NoError(err)
r.Equal(s, `[99]
`)

paramValue, err = wfCtx.MakeParameter(`context: {name: "test"}`)
r.NoError(err)
err = Input(wfCtx, paramValue, v1alpha1.WorkflowStep{
Expand Down
Loading