Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GC for User addon #770

Merged
merged 2 commits into from
Jun 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
improve test code that sometimes fail
jlandowner committed Jun 21, 2023
commit c3fad88cfdd42a4cc18fc7a436053f3bbc094558
9 changes: 6 additions & 3 deletions internal/controllers/instance_controller_test.go
Original file line number Diff line number Diff line change
@@ -177,13 +177,16 @@ spec:
By("fetching instance resource and checking if last applied resources added in instance status")

var createdInst cosmov1alpha1.Instance
Eventually(func() error {
Eventually(func() int {
key := client.ObjectKey{
Name: inst.Name,
Namespace: inst.Namespace,
}
return k8sClient.Get(ctx, key, &createdInst)
}, time.Second*10).Should(Succeed())
err = k8sClient.Get(ctx, key, &createdInst)
Expect(err).ShouldNot(HaveOccurred())

return createdInst.Status.LastAppliedObjectsCount
}, time.Second*10).ShouldNot(BeZero())
Ω(InstanceSnapshot(&createdInst)).To(MatchSnapShot())
})
})
8 changes: 5 additions & 3 deletions internal/controllers/workspace_controller_test.go
Original file line number Diff line number Diff line change
@@ -229,9 +229,11 @@ spec:
Expect(InstanceSnapshot(&createdInst)).To(MatchSnapShot())

var createdIngRoute traefikv1.IngressRoute
Eventually(func() error {
return k8sClient.Get(ctx, client.ObjectKey{Name: wsName, Namespace: nsName}, &createdIngRoute)
}, time.Second*10).Should(Succeed())
Eventually(func() int {
err := k8sClient.Get(ctx, client.ObjectKey{Name: wsName, Namespace: nsName}, &createdIngRoute)
Expect(err).ShouldNot(HaveOccurred())
return len(createdIngRoute.Spec.Routes)
}, time.Second*10).ShouldNot(BeZero())
Expect(ObjectSnapshot(&createdIngRoute)).To(MatchSnapShot())
})
})