From 0ec08c72591e887ad6d2fec10333169cf1fe21d2 Mon Sep 17 00:00:00 2001 From: Alan Clucas Date: Fri, 17 Nov 2023 13:14:26 +0000 Subject: [PATCH] chore: add test for missing child node This test is providing a regression test for #12165. As promised in It verifies that a child link is correctly made in the case of a step with outputs. Signed-off-by: Alan Clucas --- test/e2e/functional/missing-steps.yaml | 72 ++++++++++++++++++++++++++ test/e2e/functional_test.go | 14 +++++ 2 files changed, 86 insertions(+) create mode 100644 test/e2e/functional/missing-steps.yaml diff --git a/test/e2e/functional/missing-steps.yaml b/test/e2e/functional/missing-steps.yaml new file mode 100644 index 000000000000..64e63450a726 --- /dev/null +++ b/test/e2e/functional/missing-steps.yaml @@ -0,0 +1,72 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Workflow +metadata: + name: missing-steps +spec: + entrypoint: main + templates: + - name: main + steps: + - - arguments: + parameters: + - name: script + value: | + echo hello + name: step1 + template: work + - - arguments: + parameters: + - name: script + value: | + echo world + name: step2 + template: work + - name: work + inputs: + parameters: + - name: script + - name: outputArtifactResultFilePath + default: /tmp/output + artifacts: + - name: inputFile + optional: true + outputs: + parameters: + - name: result + valueFrom: + parameter: '{{steps.execute-script.outputs.result}}' + artifacts: + - name: resultFile + optional: true + from: '{{steps.execute-script.outputs.artifacts.resultFile}}' + steps: + - - name: execute-script + template: execute-target-script + arguments: + parameters: + - name: script + value: '{{inputs.parameters.script}}' + - name: outputArtifactResultFilePath + value: '{{inputs.parameters.outputArtifactResultFilePath}}' + artifacts: + - name: inputFile + from: '{{inputs.artifacts.inputFile}}' + - name: execute-target-script + inputs: + parameters: + - name: script + - name: outputArtifactResultFilePath + default: /tmp/output + artifacts: + - name: inputFile + optional: true + path: /tmp/inputFile + outputs: + artifacts: + - name: resultFile + optional: true + path: '{{inputs.parameters.outputArtifactResultFilePath}}' + script: + command: [ 'bash' ] + image: 'argoproj/argosay:v2' + source: '{{inputs.parameters.script}}' diff --git a/test/e2e/functional_test.go b/test/e2e/functional_test.go index 543d672e0798..579e1eda30c3 100644 --- a/test/e2e/functional_test.go +++ b/test/e2e/functional_test.go @@ -1200,3 +1200,17 @@ func (s *FunctionalSuite) TestEntrypointName() { }) } + +func (s *FunctionalSuite) TestMissingStepsInUI() { + s.Given(). + Workflow(`@functional/missing-steps.yaml`). + When(). + SubmitWorkflow(). + WaitForWorkflow(fixtures.ToBeSucceeded). + Then(). + ExpectWorkflowNode(wfv1.NodeWithName(`missing-steps[0].step1[0].execute-script`), func(t *testing.T, n *wfv1.NodeStatus, _ *apiv1.Pod) { + assert.NotNil(t, n) + assert.NotNil(t, n.Children) + assert.Equal(t, 1, len(n.Children)) + }) +}