TestInvalidResourceWorkflow verifies an error against a workflow of an invalid resource.
(t *testing.T)
| 1678 | |
| 1679 | // TestInvalidResourceWorkflow verifies an error against a workflow of an invalid resource. |
| 1680 | func 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 | |
| 1691 | var invalidPodGC = ` |
| 1692 | metadata: |
nothing calls this directly
no test coverage detected