Skip to content

Commit

Permalink
fix(test): adapt ARGO_TEMPLATE env changes.
Browse files Browse the repository at this point in the history
Signed-off-by: oninowang <[email protected]>
  • Loading branch information
jswxstw authored and oninowang committed Oct 16, 2024
1 parent 0eaae26 commit 6aadfae
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions workflow/controller/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,7 @@ func TestAssessNodeStatus(t *testing.T) {

func getPodTemplate(pod *apiv1.Pod) (*wfv1.Template, error) {
tmpl := &wfv1.Template{}
for _, c := range pod.Spec.Containers {
for _, c := range pod.Spec.InitContainers {
for _, e := range c.Env {
if e.Name == common.EnvVarTemplate {
return tmpl, json.Unmarshal([]byte(e.Value), tmpl)
Expand Down Expand Up @@ -1817,7 +1817,7 @@ func TestGetPodTemplate(t *testing.T) {
name: "missing template",
pod: &apiv1.Pod{
Spec: apiv1.PodSpec{
Containers: []apiv1.Container{
InitContainers: []apiv1.Container{
{
Env: []apiv1.EnvVar{},
},
Expand All @@ -1829,7 +1829,7 @@ func TestGetPodTemplate(t *testing.T) {
name: "empty template",
pod: &apiv1.Pod{
Spec: apiv1.PodSpec{
Containers: []apiv1.Container{
InitContainers: []apiv1.Container{
{
Env: []apiv1.EnvVar{
{
Expand All @@ -1846,7 +1846,7 @@ func TestGetPodTemplate(t *testing.T) {
name: "simple template",
pod: &apiv1.Pod{
Spec: apiv1.PodSpec{
Containers: []apiv1.Container{
InitContainers: []apiv1.Container{
{
Env: []apiv1.EnvVar{
{
Expand Down Expand Up @@ -7310,8 +7310,8 @@ func TestWFWithRetryAndWithParam(t *testing.T) {
ctrs := pods.Items[0].Spec.Containers
assert.Len(t, ctrs, 2)
envs := ctrs[1].Env
assert.Len(t, envs, 8)
assert.Equal(t, apiv1.EnvVar{Name: "ARGO_INCLUDE_SCRIPT_OUTPUT", Value: "true"}, envs[3])
assert.Len(t, envs, 7)
assert.Equal(t, apiv1.EnvVar{Name: "ARGO_INCLUDE_SCRIPT_OUTPUT", Value: "true"}, envs[2])
})
}

Expand Down

0 comments on commit 6aadfae

Please sign in to comment.