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

Function TestRetryNodeOutputs

workflow/controller/operator_test.go:4802–4827  ·  view source on GitHub ↗

This tests to see if the outputs of the last child node of a retry node are added correctly to the scope

(t *testing.T)

Source from the content-addressed store, hash-verified

4800
4801// This tests to see if the outputs of the last child node of a retry node are added correctly to the scope
4802func TestRetryNodeOutputs(t *testing.T) {
4803 cancel, controller := newController(logging.TestContext(t.Context()))
4804 defer cancel()
4805 ctx := logging.TestContext(t.Context())
4806 wfcset := controller.wfclientset.ArgoprojV1alpha1().Workflows("")
4807 wf := wfv1.MustUnmarshalWorkflow(retryNodeOutputs)
4808 wf, err := wfcset.Create(ctx, wf, metav1.CreateOptions{})
4809 require.NoError(t, err)
4810 wf, err = wfcset.Get(ctx, wf.Name, metav1.GetOptions{})
4811 require.NoError(t, err)
4812 woc := newWorkflowOperationCtx(ctx, wf, controller)
4813
4814 retryNode, err := woc.wf.GetNodeByName("daemon-step-dvbnn[0].influx")
4815 require.NoError(t, err)
4816 assert.NotNil(t, retryNode)
4817 fmt.Println(retryNode)
4818 scope := &wfScope{
4819 scope: make(map[string]interface{}),
4820 }
4821 woc.buildLocalScope(scope, "steps.influx", retryNode)
4822 assert.Contains(t, scope.scope, "steps.influx.ip")
4823 assert.Contains(t, scope.scope, "steps.influx.id")
4824 assert.Contains(t, scope.scope, "steps.influx.startedAt")
4825 assert.Contains(t, scope.scope, "steps.influx.finishedAt")
4826 assert.Contains(t, scope.scope, "steps.influx.hostNodeName")
4827}
4828
4829var workflowWithPVCAndFailingStep = `
4830apiVersion: argoproj.io/v1alpha1

Callers

nothing calls this directly

Calls 11

TestContextFunction · 0.92
newControllerFunction · 0.85
cancelFunction · 0.85
newWorkflowOperationCtxFunction · 0.85
GetNodeByNameMethod · 0.80
buildLocalScopeMethod · 0.80
ContextMethod · 0.65
WorkflowsMethod · 0.65
ArgoprojV1alpha1Method · 0.65
CreateMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected