Skip to content

Commit

Permalink
fix: added e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: isubasinghe <isitha@pipekit.io>
  • Loading branch information
isubasinghe committed Jan 30, 2024
1 parent 44d748f commit de570d3
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions test/e2e/expr_lang.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//go:build functional
// +build functional

package e2e

import (
"strings"
"testing"

"github.com/argoproj/argo-workflows/v3/test/e2e/fixtures"
"github.com/stretchr/testify/suite"
"gotest.tools/v3/assert"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)

type ExprSuite struct {
fixtures.E2ESuite
}

func (s *ExprSuite) TestRegression12037() {
s.Given().
Workflow(`apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: broken-
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: split
template: foo
- name: map
template: foo
depends: split
- name: foo
container:
image: alpine
command:
- sh
- -c
- |
echo "foo"
`).When().
SubmitWorkflow().
WaitForWorkflow(fixtures.ToBeSucceeded).
Then().
ExpectWorkflow(func(t *testing.T, metadata *v1.ObjectMeta, status *v1alpha1.WorkflowStatus) {

Check failure on line 50 in test/e2e/expr_lang.go

View workflow job for this annotation

GitHub Actions / Lint

v1.ObjectMeta (value of type func() *"k8s.io/client-go/applyconfigurations/meta/v1".ObjectMetaApplyConfiguration) is not a type

Check failure on line 50 in test/e2e/expr_lang.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: v1alpha1
assert.Equal(t, status.Phase, v1alpha1.WorkflowSuceeded)

Check failure on line 51 in test/e2e/expr_lang.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: v1alpha1
}).
ExpectWorkflowNode(func(status v1alpha1.nodeStatus) bool {

Check failure on line 53 in test/e2e/expr_lang.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: v1alpha1
return strings.Contains(status.name, ".split")
}, func(t *testing.T, status *v1alpha1.NodeStatus, pod *apiv1.Pod) {

Check failure on line 55 in test/e2e/expr_lang.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: v1alpha1

Check failure on line 55 in test/e2e/expr_lang.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: apiv1
assert.Equal(t, v1alpha1.NodeSucceeded, status.Phase)

Check failure on line 56 in test/e2e/expr_lang.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: v1alpha1
}).
ExpectWorkflowNode(func(status v1alpha1.nodeStatus) bool {

Check failure on line 58 in test/e2e/expr_lang.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: v1alpha1
return strings.Contains(status.name, ".map")
}, func(t *testing.T, status *v1alpha1.NodeStatus, pod *apiv1.Pod) {

Check failure on line 60 in test/e2e/expr_lang.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: v1alpha1

Check failure on line 60 in test/e2e/expr_lang.go

View workflow job for this annotation

GitHub Actions / Lint

undefined: apiv1
assert.Equal(t, v1alpha1.NodeSucceeded, status.Phase)
})
}

func TestExprLangSSuite(t *testing.T) {
suite.Run(t, new(ExprSuite))
}

0 comments on commit de570d3

Please sign in to comment.