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)
| 4800 | |
| 4801 | // This tests to see if the outputs of the last child node of a retry node are added correctly to the scope |
| 4802 | func 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 | |
| 4829 | var workflowWithPVCAndFailingStep = ` |
| 4830 | apiVersion: argoproj.io/v1alpha1 |
nothing calls this directly
no test coverage detected