From c64edcbffeff439b9acc6369cf77500b0878a5fd Mon Sep 17 00:00:00 2001 From: Pasquale Congiusti Date: Tue, 25 Aug 2026 08:27:12 +0200 Subject: [PATCH] chore(e2e): bind condition status --- e2e/common/cli/bind_test.go | 24 ++++++++++++++---------- e2e/support/test_support.go | 10 ---------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/e2e/common/cli/bind_test.go b/e2e/common/cli/bind_test.go index 2971317ce3..44170d35f2 100644 --- a/e2e/common/cli/bind_test.go +++ b/e2e/common/cli/bind_test.go @@ -31,6 +31,7 @@ import ( . "github.com/onsi/gomega" . "github.com/apache/camel-k/v2/e2e/support" + v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" ) func TestKamelCLIBind(t *testing.T) { @@ -40,22 +41,25 @@ func TestKamelCLIBind(t *testing.T) { g.Expect(CreateTimerKamelet(t, ctx, ns, kameletName)()).To(Succeed()) t.Run("bind timer to log", func(t *testing.T) { + pipeName := "test-timer-source-to-log" g.Expect(KamelBind(t, ctx, ns, kameletName, "log:info", "-p", "source.message=helloTest").Execute()).To(Succeed()) - g.Eventually(IntegrationPodPhase(t, ctx, ns, "test-timer-source-to-log"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) - g.Eventually(IntegrationLogs(t, ctx, ns, "test-timer-source-to-log")).Should(ContainSubstring("Body: helloTest")) - g.Expect(KamelBind(t, ctx, ns, "test-timer-source", "log:info", "-p", "source.message=newText").Execute()).To(Succeed()) - g.Eventually(IntegrationLogs(t, ctx, ns, "test-timer-source-to-log")).Should(ContainSubstring("Body: newText")) + g.Eventually(IntegrationConditionStatus(t, ctx, ns, pipeName, v1.IntegrationConditionReady), TestTimeoutMedium). + Should(Equal(corev1.ConditionTrue)) + g.Eventually(IntegrationPodPhase(t, ctx, ns, pipeName)).Should(Equal(corev1.PodRunning)) + g.Eventually(IntegrationLogs(t, ctx, ns, pipeName)).Should(ContainSubstring("Body: helloTest")) + + g.Expect(KamelBind(t, ctx, ns, kameletName, "log:info", "-p", "source.message=newText").Execute()).To(Succeed()) + g.Eventually(IntegrationConditionStatus(t, ctx, ns, pipeName, v1.IntegrationConditionReady), TestTimeoutMedium). + Should(Equal(corev1.ConditionTrue)) + g.Eventually(IntegrationLogs(t, ctx, ns, pipeName)).Should(ContainSubstring("Body: newText")) }) t.Run("bind uris", func(t *testing.T) { g.Expect(KamelBind(t, ctx, ns, "timer:foo", "log:bar").Execute()).To(Succeed()) - g.Eventually(IntegrationPodPhase(t, ctx, ns, "timer-to-log"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) + g.Eventually(IntegrationConditionStatus(t, ctx, ns, "timer-to-log", v1.IntegrationConditionReady), TestTimeoutMedium). + Should(Equal(corev1.ConditionTrue)) + g.Eventually(IntegrationPodPhase(t, ctx, ns, "timer-to-log")).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationLogs(t, ctx, ns, "timer-to-log")).Should(ContainSubstring("Body is null")) }) - - t.Run("bind with custom SA", func(t *testing.T) { - g.Expect(KamelBind(t, ctx, ns, "timer:foo", "log:bar", "--service-account", "my-service-account").Execute()).To(Succeed()) - g.Eventually(IntegrationSpecSA(t, ctx, ns, "timer-to-log")).Should(Equal("my-service-account")) - }) }) } diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go index 4158b0a085..dab27c0502 100644 --- a/e2e/support/test_support.go +++ b/e2e/support/test_support.go @@ -870,16 +870,6 @@ func IntegrationStatusCapabilities(t *testing.T, ctx context.Context, ns string, } } -func IntegrationSpecSA(t *testing.T, ctx context.Context, ns string, name string) func() string { - return func() string { - it := Integration(t, ctx, ns, name)() - if it == nil { - return "" - } - return it.Spec.ServiceAccountName - } -} - func IntegrationKitName(t *testing.T, ctx context.Context, ns string, name string) func() string { return func() string { it := Integration(t, ctx, ns, name)()