Skip to content

Commit

Permalink
[util/e2e] Rework KueueReadyForTesting.
Browse files Browse the repository at this point in the history
  • Loading branch information
trasc committed Jan 30, 2024
1 parent 25dd4bf commit 387a10b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/util/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,19 @@ func CreateVisibilityClient(user string) visibilityv1alpha1.VisibilityV1alpha1In
return visibilityClient
}

func KueueReadyForTesting(ctx context.Context, client client.Client) {
func KueueReadyForTesting(ctx context.Context, c client.Client) {
// To verify that webhooks are ready, let's create a simple resourceflavor
resourceKueue := utiltesting.MakeResourceFlavor("default").Obj()
gomega.Eventually(func() error {
return client.Create(context.Background(), resourceKueue)
gomega.EventuallyWithOffset(1, func() error {
return c.Create(ctx, resourceKueue)
}, StartUpTimeout, Interval).Should(gomega.Succeed())
ExpectResourceFlavorToBeDeleted(ctx, client, resourceKueue, true)

gomega.EventuallyWithOffset(1, func() error {
return c.Delete(ctx, resourceKueue)
}, StartUpTimeout, Interval).Should(gomega.Succeed())

gomega.EventuallyWithOffset(1, func() error {
oldRf := &kueue.ResourceFlavor{}
return c.Get(ctx, client.ObjectKeyFromObject(resourceKueue), oldRf)
}, StartUpTimeout, Interval).Should(utiltesting.BeNotFoundError())
}

0 comments on commit 387a10b

Please sign in to comment.