This is an automated email from the ASF dual-hosted git repository. pcongiusti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 05b854d7ec86ee0e5726fc7bab035a8bbadef379 Author: Pasquale Congiusti <[email protected]> AuthorDate: Fri Oct 11 08:28:13 2024 +0200 chore(ci): adjust tests for runtime 3.15 --- e2e/advanced/operator_restart_test.go | 7 ++++++- e2e/common/misc/pipe_test.go | 22 ++++++++++++++++++---- pkg/controller/integrationplatform/create.go | 8 ++++++-- pkg/controller/integrationplatform/kamelets.go | 2 +- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/e2e/advanced/operator_restart_test.go b/e2e/advanced/operator_restart_test.go index 0f84972d5..a2e0368fe 100644 --- a/e2e/advanced/operator_restart_test.go +++ b/e2e/advanced/operator_restart_test.go @@ -66,7 +66,12 @@ func TestOperatorRestart(t *testing.T) { }) t.Run("Operator reinstalled", func(t *testing.T) { - InstallOperator(t, ctx, g, ns) + // Install Camel K without Kamelets. There may be loading error that could affect the validity of this test. + InstallOperatorWithConf(t, ctx, g, ns, "", false, + map[string]string{ + "KAMEL_INSTALL_DEFAULT_KAMELETS": "false", + }, + ) g.Eventually(OperatorPod(t, ctx, ns)).Should(Not(BeNil())) g.Eventually(PlatformPhase(t, ctx, ns), TestTimeoutShort).Should(Equal(v1.IntegrationPlatformPhaseReady)) g.Consistently(OperatorLogs(t, ctx, ns), 1*time.Minute, 3*time.Second).Should(Not(ContainSubstring("error"))) diff --git a/e2e/common/misc/pipe_test.go b/e2e/common/misc/pipe_test.go index 1093b9d6e..8a89c7a19 100644 --- a/e2e/common/misc/pipe_test.go +++ b/e2e/common/misc/pipe_test.go @@ -58,8 +58,13 @@ func TestPipe(t *testing.T) { "--name", "throw-error-binding").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "throw-error-binding"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) - g.Eventually(IntegrationLogs(t, ctx, ns, "throw-error-binding"), TestTimeoutShort).Should(ContainSubstring("[kameletErrorHandler] (Camel (camel-1) thread #1 - timer://tick)")) - g.Eventually(IntegrationLogs(t, ctx, ns, "throw-error-binding"), TestTimeoutShort).ShouldNot(ContainSubstring("[integrationLogger] (Camel (camel-1) thread #1 - timer://tick)")) + g.Eventually(IntegrationLogs(t, ctx, ns, "throw-error-binding"), TestTimeoutShort). + Should(And( + ContainSubstring("[kameletErrorHandler]"), + ContainSubstring("throw Error"), + )) + g.Eventually(IntegrationLogs(t, ctx, ns, "throw-error-binding"), TestTimeoutShort). + ShouldNot(ContainSubstring("[integrationLogger]")) }) @@ -74,8 +79,17 @@ func TestPipe(t *testing.T) { "--name", "no-error-binding").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "no-error-binding"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) - g.Eventually(IntegrationLogs(t, ctx, ns, "no-error-binding"), TestTimeoutShort).ShouldNot(ContainSubstring("[kameletErrorHandler] (Camel (camel-1) thread #1 - timer://tick)")) - g.Eventually(IntegrationLogs(t, ctx, ns, "no-error-binding"), TestTimeoutShort).Should(ContainSubstring("[integrationLogger] (Camel (camel-1) thread #1 - timer://tick)")) + g.Eventually(IntegrationLogs(t, ctx, ns, "no-error-binding"), TestTimeoutShort). + ShouldNot( + And( + ContainSubstring("[kameletErrorHandler]"), + ContainSubstring("throw Error"), + )) + g.Eventually(IntegrationLogs(t, ctx, ns, "no-error-binding"), TestTimeoutShort). + Should(And( + ContainSubstring("[integrationLogger]"), + ContainSubstring("true"), + )) }) }) diff --git a/pkg/controller/integrationplatform/create.go b/pkg/controller/integrationplatform/create.go index 55e9ca3f3..a53044749 100644 --- a/pkg/controller/integrationplatform/create.go +++ b/pkg/controller/integrationplatform/create.go @@ -175,12 +175,16 @@ func installKamelets(ctx context.Context, c client.Client, platform *v1.Integrat fmt.Sprintf("kamelet catalog %s not available. Error: %s", camelVersion, err), ) } else { + message := fmt.Sprintf("successfully installed Kamelet catalog version %s: success %d Kamelets, failed %d Kamelets", + camelVersion, installedKam, erroredKam) + if erroredKam > 0 { + message += ". Check operator log to discover more about the failure" + } platform.Status.SetCondition( v1.IntegrationPlatformConditionKameletCatalogAvailable, corev1.ConditionTrue, "IntegrationPlatformKameletCatalogAvailable", - fmt.Sprintf("successfully installed Kamelet catalog version %s: success %d Kamelets, failed %d Kamelets", - camelVersion, installedKam, erroredKam), + message, ) } } diff --git a/pkg/controller/integrationplatform/kamelets.go b/pkg/controller/integrationplatform/kamelets.go index 83cfa5d6d..9ff27c956 100644 --- a/pkg/controller/integrationplatform/kamelets.go +++ b/pkg/controller/integrationplatform/kamelets.go @@ -146,7 +146,7 @@ func applyKamelets(ctx context.Context, c client.Client, platform *v1.Integratio err = applier.Apply(ctx, kamelet) if err != nil { erroredKam++ - log.Error(err, "Error occurred whilst applying a bundled kamelet named %s", kamelet.GetName()) + log.Errorf(err, "Error occurred whilst applying a bundled kamelet named %s", kamelet.GetName()) return nil } appliedKam++
