Skip to content

Commit

Permalink
chore: bump duty and improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe authored and moshloop committed Sep 12, 2024
1 parent 5730766 commit 3784f60
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions scrapers/runscrapers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"]))
}
})
}
})
Expand Down

0 comments on commit 3784f60

Please sign in to comment.