Skip to content

Commit

Permalink
fix: Flakey TestNestedClusterWorkflowTemplate testcase failure (argop…
Browse files Browse the repository at this point in the history
  • Loading branch information
sarabala1979 committed Apr 15, 2020
1 parent b4fd447 commit db6d141
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 40 deletions.
36 changes: 21 additions & 15 deletions test/e2e/cluster_workflow_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,36 @@ func (s *ClusterWorkflowTemplateSuite) TestSubmitClusterWorkflowTemplate() {
}

func (s *ClusterWorkflowTemplateSuite) TestNestedClusterWorkflowTemplate() {
// https://github.com/argoproj/argo/issues/2622
s.T().SkipNow()
s.Given().WorkflowTemplate("@smoke/cluster-workflow-template-whalesay-template.yaml").
WorkflowTemplate("@testdata/cluster-workflow-template-nested-template.yaml").
Workflow(`apiVersion: argoproj.io/v1alpha1
s.Given().
ClusterWorkflowTemplate("@testdata/cluster-workflow-template-nested-template.yaml").
When().Given().
ClusterWorkflowTemplate("@smoke/cluster-workflow-template-whalesay-template.yaml").
When().CreateClusterWorkflowTemplates().
Given().
WorkflowName("cwft-wf").
Workflow(`
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: workflow-template-nested-
name: cwft-wf
namespace: argo
labels:
argo-e2e: true
spec:
entrypoint: whalesay
templates:
- name: whalesay
inputs:
parameters:
- name: message
value: hello from nested
templateRef:
name: cluster-workflow-template-nested-template
template: whalesay-template
clusterscope: true
steps:
- - name: call-whalesay-template
templateRef:
name: cluster-workflow-template-nested-template
template: whalesay-template
clusterscope: true
arguments:
parameters:
- name: message
value: hello from nested
`).When().
CreateClusterWorkflowTemplates().
SubmitWorkflow().
WaitForWorkflow(30 * time.Second).
Then().
Expand Down
1 change: 1 addition & 0 deletions test/e2e/fixtures/when.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ func (w *When) Given() *Given {
offloadNodeStatusRepo: w.offloadNodeStatusRepo,
wf: w.wf,
wfTemplates: w.wfTemplates,
cwfTemplates: w.cwfTemplates,
cronWf: w.cronWf,
workflowName: w.workflowName,
kubeClient: w.kubeClient,
Expand Down
33 changes: 33 additions & 0 deletions test/e2e/manifests/mixins/cluster-workflow-template-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: argo-server-clusterworkflowtemplate-role
rules:
- apiGroups:
- argoproj.io
resources:
- clusterworkflowtemplates
- clusterworkflowtemplates/finalizers
verbs:
- get
- list
- watch
- create
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: argo-clusterworkflowtemplate-role
rules:
- apiGroups:
- argoproj.io
resources:
- clusterworkflowtemplates
- clusterworkflowtemplates/finalizers
verbs:
- get
- list
- watch
- create
- delete
4 changes: 4 additions & 0 deletions test/e2e/manifests/mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ rules:
- get
- list
- watch
- create
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand All @@ -273,6 +275,8 @@ rules:
- get
- list
- watch
- create
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Expand Down
1 change: 1 addition & 0 deletions test/e2e/manifests/mysql/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ patchesStrategicMerge:
- ../mixins/argo-server-deployment.yaml
- ../mixins/workflow-controller-configmap.yaml
- ../mixins/workflow-controller-deployment.yaml
- ../mixins/cluster-workflow-template-rbac.yaml
4 changes: 4 additions & 0 deletions test/e2e/manifests/no-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ rules:
- get
- list
- watch
- create
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand All @@ -273,6 +275,8 @@ rules:
- get
- list
- watch
- create
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Expand Down
1 change: 1 addition & 0 deletions test/e2e/manifests/no-db/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ patchesStrategicMerge:
- ../mixins/argo-server-deployment.yaml
- ../mixins/workflow-controller-configmap.yaml
- ../mixins/workflow-controller-deployment.yaml
- ../mixins/cluster-workflow-template-rbac.yaml
4 changes: 4 additions & 0 deletions test/e2e/manifests/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ rules:
- get
- list
- watch
- create
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand All @@ -273,6 +275,8 @@ rules:
- get
- list
- watch
- create
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Expand Down
1 change: 1 addition & 0 deletions test/e2e/manifests/postgres/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ patchesStrategicMerge:
- ../mixins/argo-server-deployment.yaml
- ../mixins/workflow-controller-configmap.yaml
- ../mixins/workflow-controller-deployment.yaml
- ../mixins/cluster-workflow-template-rbac.yaml
16 changes: 0 additions & 16 deletions test/e2e/testdata/cluster-workflow-template-nested-template.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
kind: ClusterWorkflowTemplate
metadata:
name: cluster-workflow-template-whalesay-template
labels:
argo-e2e: true
spec:
templates:
- name: whalesay-template
inputs:
parameters:
- name: message
container:
image: docker/whalesay
command: [cowsay]
args: ["{{inputs.parameters.message}}"]
---
apiVersion: argoproj.io/v1alpha1
kind: ClusterWorkflowTemplate
metadata:
Expand Down
24 changes: 15 additions & 9 deletions test/e2e/workflow_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ func (s *WorkflowTemplateSuite) TestSubmitWorkflowTemplate() {
}

func (s *WorkflowTemplateSuite) TestNestedWorkflowTemplate() {
s.Given().WorkflowTemplate("@smoke/workflow-template-whalesay-template.yaml").
s.Given().
WorkflowTemplate("@testdata/workflow-template-nested-template.yaml").
When().Given().
WorkflowTemplate("@smoke/workflow-template-whalesay-template.yaml").
When().
CreateWorkflowTemplates().
Given().
Workflow(`apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
Expand All @@ -45,15 +50,16 @@ spec:
entrypoint: whalesay
templates:
- name: whalesay
inputs:
parameters:
- name: message
value: hello from nested
templateRef:
name: workflow-template-nested-template
template: whalesay-template
steps:
- - name: call-whalesay-template
templateRef:
name: workflow-template-nested-template
template: whalesay-template
arguments:
parameters:
- name: message
value: "hello from nested"
`).When().
CreateWorkflowTemplates().
SubmitWorkflow().
WaitForWorkflow(30 * time.Second).
Then().
Expand Down

0 comments on commit db6d141

Please sign in to comment.