Skip to content

Commit

Permalink
tests: dscinitialization_test: add missing Context
Browse files Browse the repository at this point in the history
Finish porting of

06e21a4 ("chore(lint): enable contextcheck and containedctx (opendatahub-io#1070)")

Some tests are not present in ODH and requires WithContext as well.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
  • Loading branch information
ykaliuta committed Aug 1, 2024
1 parent 76c0b5c commit 0bcc1a6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions controllers/dscinitialization/dscinitialization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ var _ = Describe("DataScienceCluster initialization", func() {
Expect(foundApplicationNamespace.Name).To(Equal(applicationNamespace))
})

It("Should create default monitoring namespace", func() {
It("Should create default monitoring namespace", func(ctx context.Context) {
// then
foundMonitoringNamespace := &corev1.Namespace{}
Eventually(namespaceExists(applicationNamespace, foundMonitoringNamespace), timeout, interval).Should(BeTrue())
Eventually(namespaceExists(applicationNamespace, foundMonitoringNamespace), timeout, interval).
WithContext(ctx).
Should(BeTrue())
Expect(foundMonitoringNamespace.Name).Should(Equal(monitoringNamespace))
})

Expand Down Expand Up @@ -166,7 +168,7 @@ var _ = Describe("DataScienceCluster initialization", func() {
AfterEach(cleanupResources)
const applicationName = "default-dsci"

It("Should not have more than one DSCI instance in the cluster", func() {
It("Should not have more than one DSCI instance in the cluster", func(ctx context.Context) {

anotherApplicationName := "default2"
// given
Expand All @@ -176,6 +178,7 @@ var _ = Describe("DataScienceCluster initialization", func() {
desiredDsci2 := createDSCI(anotherApplicationName, operatorv1.Managed, operatorv1.Managed, monitoringNamespace)
// then
Eventually(dscInitializationIsReady(anotherApplicationName, workingNamespace, desiredDsci2)).
WithContext(ctx).
WithTimeout(timeout).
WithPolling(interval).
Should(BeFalse())
Expand Down

0 comments on commit 0bcc1a6

Please sign in to comment.