MCPcopy
hub / github.com/argoproj/argo-workflows / TestInvalidResourceWorkflow

Function TestInvalidResourceWorkflow

workflow/validate/validate_test.go:1680–1689  ·  view source on GitHub ↗

TestInvalidResourceWorkflow verifies an error against a workflow of an invalid resource.

(t *testing.T)

Source from the content-addressed store, hash-verified

1678
1679// TestInvalidResourceWorkflow verifies an error against a workflow of an invalid resource.
1680func TestInvalidResourceWorkflow(t *testing.T) {
1681 wf := unmarshalWf(invalidResourceWorkflow)
1682 ctx := logging.TestContext(t.Context())
1683 err := ValidateWorkflow(ctx, wftmplGetter, cwftmplGetter, wf, nil, ValidateOpts{})
1684 require.EqualError(t, err, "templates.whalesay.resource.manifest must be a valid yaml")
1685
1686 wf = unmarshalWf(invalidActionResourceWorkflow)
1687 err = ValidateWorkflow(ctx, wftmplGetter, cwftmplGetter, wf, nil, ValidateOpts{})
1688 require.EqualError(t, err, "templates.whalesay.resource.action must be one of: get, create, apply, delete, replace, patch")
1689}
1690
1691var invalidPodGC = `
1692metadata:

Callers

nothing calls this directly

Calls 4

TestContextFunction · 0.92
unmarshalWfFunction · 0.85
ValidateWorkflowFunction · 0.85
ContextMethod · 0.65

Tested by

no test coverage detected