From 3784f609b759c3bb749c8e73c86cfb3acf393116 Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Wed, 11 Sep 2024 20:20:52 +0545 Subject: [PATCH] chore: bump duty and improve tests --- scrapers/runscrapers_test.go | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/scrapers/runscrapers_test.go b/scrapers/runscrapers_test.go index 27149f1b..e53234eb 100644 --- a/scrapers/runscrapers_test.go +++ b/scrapers/runscrapers_test.go @@ -154,11 +154,25 @@ var _ = Describe("Dedup test", Ordered, func() { }) It(fmt.Sprintf("[%d] should have the updated the db", i), func() { - err := DefaultContext.DB().Where("name = ?", "change-dedup-test").First(&cmA).Error - Expect(err).NotTo(HaveOccurred(), "failed to find configmap") + { + err := DefaultContext.DB().Where("name = ?", configA.Name).First(&cmA).Error + Expect(err).NotTo(HaveOccurred(), "failed to find configmap") + + var configMap apiv1.ConfigMap + err = json.Unmarshal([]byte(*cmA.Config), &configMap) + Expect(err).NotTo(HaveOccurred()) + Expect(configMap.Data["key"]).To(Equal(configA.Data["key"])) + } + + { + err := DefaultContext.DB().Where("name = ?", configB.Name).First(&cmB).Error + Expect(err).NotTo(HaveOccurred(), "failed to find configmap") - err = DefaultContext.DB().Where("name = ?", "change-dedup-test").First(&cmB).Error - Expect(err).NotTo(HaveOccurred(), "failed to find configmap") + var configMap apiv1.ConfigMap + err = json.Unmarshal([]byte(*cmB.Config), &configMap) + Expect(err).NotTo(HaveOccurred()) + Expect(configMap.Data["key"]).To(Equal(configB.Data["key"])) + } }) } })