(t *testing.T)
| 130 | ` |
| 131 | |
| 132 | func TestCounters(t *testing.T) { |
| 133 | woc := getWfOperationCtx() |
| 134 | var pod v1.Pod |
| 135 | v1alpha1.MustUnmarshal([]byte(podStr), &pod) |
| 136 | assert.NotNil(t, pod) |
| 137 | pod1 := pod.DeepCopy() |
| 138 | pod1.Name = "2" |
| 139 | cancel, controller := newController(logging.TestContext(t.Context())) |
| 140 | defer cancel() |
| 141 | woc.controller = controller |
| 142 | syncPodsInformer(logging.TestContext(t.Context()), woc, pod, *pod1) |
| 143 | assert.Equal(t, int64(2), woc.getActivePods("1")) |
| 144 | // No BoundaryID requested |
| 145 | assert.Equal(t, int64(4), woc.getActivePods("")) |
| 146 | assert.Equal(t, int64(5), woc.getActiveChildren("1")) |
| 147 | assert.Equal(t, int64(3), woc.getUnsuccessfulChildren("1")) |
| 148 | assert.Equal(t, int64(2), woc.getActivePods("2")) |
| 149 | assert.Equal(t, int64(2), woc.getActiveChildren("2")) |
| 150 | assert.Equal(t, int64(2), woc.getUnsuccessfulChildren("2")) |
| 151 | |
| 152 | testNodePodExists(t, woc) |
| 153 | } |
| 154 | |
| 155 | func testNodePodExists(t *testing.T, woc *wfOperationCtx) { |
| 156 | for _, node := range woc.wf.Status.Nodes { |
nothing calls this directly
no test coverage detected