Skip to content

Commit

Permalink
test(e2e): add podSpecPatch test
Browse files Browse the repository at this point in the history
Signed-off-by: Tianchu Zhao <evantczhao@gmail.com>
  • Loading branch information
tczhao committed Feb 4, 2021
1 parent 41af29d commit 96c8279
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions test/e2e/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,39 @@ func (s *FunctionalSuite) TestK8SJSONPatch() {
})
}

func (s *FunctionalSuite) TestWorkflowPodSpecPatch() {
s.Given().
Workflow(`apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: basic
labels:
argo-e2e: true
spec:
entrypoint: main
templates:
- name: main
container:
image: argoproj/argosay:v2
args:
- echo
- ":) Hello Argo!"
podSpecPatch: '{"terminationGracePeriodSeconds":5, "containers":[{"name":"main", "resources":{"limits":{"cpu": "100m"}}}]}'
`).
When().
SubmitWorkflow().
WaitForWorkflow().
Then().
ExpectWorkflowNode(wfv1.SucceededPodNode, func(t *testing.T, n *wfv1.NodeStatus, p *corev1.Pod) {
assert.Equal(t, *p.Spec.TerminationGracePeriodSeconds, int64(5))
for _, c := range p.Spec.Containers {
if c.Name == "main" {
assert.Equal(t, c.Resources.Limits.Cpu().String(), "100m")
}
}
})
}

func TestFunctionalSuite(t *testing.T) {
suite.Run(t, new(FunctionalSuite))
}

0 comments on commit 96c8279

Please sign in to comment.