Skip to content

Commit

Permalink
fix(e2e): olm needs to create an Integration Platform
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Aug 21, 2024
1 parent fca5132 commit 932f7ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 6 additions & 6 deletions e2e/install/olm/olm_install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ func TestOLMInstallation(t *testing.T) {
g.Eventually(OperatorPodPhase(t, ctx, ns), TestTimeoutMedium).Should(Equal(corev1.PodRunning))
g.Eventually(OperatorImage(t, ctx, ns), TestTimeoutShort).Should(Equal(defaults.OperatorImage()))

// Check the IntegrationPlatform has been reconciled after setting the expected container registry
g.Eventually(Platform(t, ctx, ns)).ShouldNot(BeNil())
g.Expect(UpdatePlatform(t, ctx, ns, func(ip *v1.IntegrationPlatform) {
ip.Spec.Build.Registry.Address = containerRegistry
ip.Spec.Build.Registry.Insecure = true
})).To(Succeed())
integrationPlatform := v1.NewIntegrationPlatform(ns, "camel-k")
integrationPlatform.Spec.Build.Registry = v1.RegistrySpec{
Address: containerRegistry,
Insecure: true,
}
g.Expect(CreateIntegrationPlatform(t, ctx, &integrationPlatform)).To(Succeed())
g.Eventually(PlatformPhase(t, ctx, ns), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
g.Eventually(PlatformVersion(t, ctx, ns), TestTimeoutMedium).Should(Equal(defaults.Version))

Expand Down
4 changes: 4 additions & 0 deletions e2e/support/test_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -2110,6 +2110,10 @@ func UpdatePlatform(t *testing.T, ctx context.Context, ns string, upd func(ip *v
return TestClient(t).Patch(ctx, target, ctrl.RawPatch(types.MergePatchType, p))
}

func CreateIntegrationPlatform(t *testing.T, ctx context.Context, ip *v1.IntegrationPlatform) error {
return TestClient(t).Create(ctx, ip)
}

func PlatformVersion(t *testing.T, ctx context.Context, ns string) func() string {
return func() string {
p := Platform(t, ctx, ns)()
Expand Down

0 comments on commit 932f7ed

Please sign in to comment.