Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Rodrigues <[email protected]>
  • Loading branch information
eduardodbr committed Nov 14, 2024
1 parent 4d59350 commit be9c0d4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/e2e/cluster_workflow_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,42 @@ package e2e
import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
"github.com/argoproj/argo-workflows/v3/test/e2e/fixtures"
"github.com/argoproj/argo-workflows/v3/workflow/common"
)

type ClusterWorkflowTemplateSuite struct {
fixtures.E2ESuite
}

func (s *ClusterWorkflowTemplateSuite) TestClusterWorkflowFromWorkflowTemplateHasLabel() {
s.Given().
ClusterWorkflowTemplate("@smoke/cluster-workflow-template-whalesay-template.yaml").
When().
CreateClusterWorkflowTemplates().
Given().
Workflow(`
metadata:
generateName: workflow-from-cluster-template-label-
spec:
workflowTemplateRef:
name: cluster-workflow-template-whalesay-template
clusterScope: true
`).
When().
SubmitWorkflow().
WaitForWorkflow(fixtures.ToBeSucceeded).
Then().
ExpectWorkflow(func(t *testing.T, metadata *v1.ObjectMeta, status *v1alpha1.WorkflowStatus) {
assert.Equal(t, "cluster-workflow-template-whalesay-template", metadata.Labels[common.LabelKeyClusterWorkflowTemplate])
})
}

func (s *ClusterWorkflowTemplateSuite) TestNestedClusterWorkflowTemplate() {
s.Given().
ClusterWorkflowTemplate("@testdata/cluster-workflow-template-nested-template.yaml").
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/cron_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ spec:
Then().
ExpectWorkflow(func(t *testing.T, metadata *metav1.ObjectMeta, status *wfv1.WorkflowStatus) {
assert.Equal(t, "workflow-template-cron", metadata.Labels[common.LabelKeyWorkflowTemplate])
})
})

s.Run("TestMultipleWithTimezone", func() {
s.Given().
Expand Down

0 comments on commit be9c0d4

Please sign in to comment.