Skip to content

Commit 320340a

Browse files
committed
test(dataflowaffinity): add post-reconcile state assertions to Reconcile specs
1 parent 1d351b6 commit 320340a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

pkg/controllers/v1alpha1/fluidapp/dataflowaffinity/dataflowaffinity_controller_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ var _ = Describe("DataOpJobReconciler", func() {
120120
})
121121
Expect(err).NotTo(HaveOccurred())
122122
Expect(result.Requeue).To(BeFalse())
123+
124+
updatedJob := &batchv1.Job{}
125+
Expect(c.Get(context.TODO(), types.NamespacedName{Name: "test-job", Namespace: "default"}, updatedJob)).To(Succeed())
126+
Expect(updatedJob.Annotations).To(HaveKeyWithValue(common.AnnotationDataFlowAffinityInject, "true"))
123127
})
124128
})
125129

@@ -181,6 +185,12 @@ var _ = Describe("DataOpJobReconciler", func() {
181185
})
182186
Expect(err).NotTo(HaveOccurred())
183187
Expect(result.Requeue).To(BeFalse())
188+
189+
updatedJob := &batchv1.Job{}
190+
Expect(c.Get(context.TODO(), types.NamespacedName{Name: "complete-job", Namespace: "default"}, updatedJob)).To(Succeed())
191+
Expect(updatedJob.Annotations).To(HaveKeyWithValue(common.AnnotationDataFlowCustomizedAffinityPrefix+common.K8sNodeNameLabelKey, "node01"))
192+
Expect(updatedJob.Annotations).To(HaveKeyWithValue(common.AnnotationDataFlowCustomizedAffinityPrefix+common.K8sRegionLabelKey, "region01"))
193+
Expect(updatedJob.Annotations).To(HaveKeyWithValue(common.AnnotationDataFlowCustomizedAffinityPrefix+common.K8sZoneLabelKey, "zone01"))
184194
})
185195
})
186196
})

0 commit comments

Comments
 (0)