Skip to content

Commit

Permalink
chore: Tidy up test/verification (#5209)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Collins <alex_collins@intuit.com>
  • Loading branch information
alexec committed Feb 25, 2021
1 parent 47ac323 commit d83cf21
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 32 deletions.
18 changes: 0 additions & 18 deletions test/e2e/functional/k8s-patch.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions test/e2e/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -792,18 +792,6 @@ spec:
})
}

func (s *FunctionalSuite) TestK8SJSONPatch() {
s.Given().
Workflow("@functional/k8s-patch.yaml").
When().
SubmitWorkflow().
WaitForWorkflow().
Then().
ExpectWorkflow(func(t *testing.T, metadata *metav1.ObjectMeta, status *wfv1.WorkflowStatus) {
assert.Equal(t, wfv1.WorkflowSucceeded, status.Phase)
})
}

func (s *FunctionalSuite) TestWorkflowPodSpecPatch() {
s.Given().
Workflow(`apiVersion: argoproj.io/v1alpha1
Expand Down
8 changes: 6 additions & 2 deletions workflow/verify/verifier.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
package verify

import (
"fmt"

_ "github.com/go-python/gpython/builtin"

"github.com/argoproj/argo-workflows/v3/pkg/apis/workflow"
wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
"github.com/argoproj/argo-workflows/v3/util/python"
)

const annotationName = workflow.WorkflowFullName + "/verify.py"

func Workflow(wf *wfv1.Workflow) error {
verify, ok := wf.GetAnnotations()[workflow.WorkflowFullName+"/verify.py"]
verify, ok := wf.GetAnnotations()[annotationName]
if !ok {
return nil
return fmt.Errorf("cannot verify workflow: annotation %s not found", annotationName)
}
nodes := wfv1.Nodes{}
for _, n := range wf.Status.Nodes {
Expand Down

0 comments on commit d83cf21

Please sign in to comment.