Skip to content

Commit

Permalink
test: add test for missing child node (argoproj#12214)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joibel authored and shuangkun committed Nov 21, 2023
1 parent 89262ec commit 1113d8b
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
72 changes: 72 additions & 0 deletions test/e2e/functional/missing-steps.yaml
Original file line number Diff line number Diff line change
@@ -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}}'
14 changes: 14 additions & 0 deletions test/e2e/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1321,3 +1321,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))
})
}

0 comments on commit 1113d8b

Please sign in to comment.