You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2022/04/01 08:35:04 UTC

[camel-k] branch main updated: test fixing of "Global test on namespace with its own operator"

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


The following commit(s) were added to refs/heads/main by this push:
     new 566ed30  test fixing of "Global test on namespace with its own operator"
566ed30 is described below

commit 566ed3061f37c7efde56b0c5cbdcf6a4900f1849
Author: Vitor Graziano <vg...@vgrazian.remote.csb>
AuthorDate: Mon Nov 15 12:34:15 2021 +0100

    test fixing of "Global test on namespace with its own operator"
---
 e2e/builder/global_test.go  | 12 +++++++++---
 e2e/support/test_support.go |  9 +++++++++
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/e2e/builder/global_test.go b/e2e/builder/global_test.go
index 5205318..8eb8e83 100644
--- a/e2e/builder/global_test.go
+++ b/e2e/builder/global_test.go
@@ -53,7 +53,7 @@ func TestRunGlobalInstall(t *testing.T) {
 
 	WithGlobalOperatorNamespace(t, func(operatorNamespace string) {
 		Expect(Kamel("install", "-n", operatorNamespace, "--global", "--force").Execute()).To(Succeed())
-
+		Eventually(OperatorPodPhase(operatorNamespace), TestTimeoutMedium).Should(Equal(corev1.PodRunning))
 		t.Run("Global test on namespace with platform", func(t *testing.T) {
 			WithNewTestNamespace(t, func(ns2 string) {
 				// Creating platform
@@ -74,12 +74,18 @@ func TestRunGlobalInstall(t *testing.T) {
 
 		t.Run("Global test on namespace with its own operator", func(t *testing.T) {
 			WithNewTestNamespace(t, func(ns3 string) {
-				Expect(Kamel("install", "-n", ns3, "--olm=false").Execute()).To(Succeed())
-
+				if NoOlmOperatorImage != "" {
+					Expect(Kamel("install", "-n", ns3, "--olm=false", "--operator-image", NoOlmOperatorImage).Execute()).To(Succeed())
+				} else {
+					Expect(Kamel("install", "-n", ns3, "--olm=false").Execute()).To(Succeed())
+				}
+				Eventually(OperatorPodPhase(ns3), TestTimeoutMedium).Should(Equal(corev1.PodRunning))
 				Expect(Kamel("run", "-n", ns3, "files/Java.java").Execute()).To(Succeed())
 				Eventually(IntegrationPodPhase(ns3, "java"), TestTimeoutMedium).Should(Equal(corev1.PodRunning))
 				Eventually(IntegrationLogs(ns3, "java"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
 				Expect(IntegrationConditionMessage(IntegrationCondition(ns3, "java", v1.IntegrationConditionPlatformAvailable)())).To(MatchRegexp(ns3 + "\\/.*"))
+				kit := IntegrationKit(ns3, "java")()
+				Expect(Kits(ns3)()).Should(WithTransform(integrationKitsToNamesTransform(), ContainElement(kit)))
 				Expect(Kamel("delete", "--all", "-n", ns3).Execute()).To(Succeed())
 
 				Expect(Lease(ns3, platform.OperatorLockName)()).ShouldNot(BeNil(),
diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go
index c57c081..b964f8a 100644
--- a/e2e/support/test_support.go
+++ b/e2e/support/test_support.go
@@ -91,6 +91,7 @@ const kubeConfigEnvVar = "KUBECONFIG"
 var TestTimeoutShort = 1 * time.Minute
 var TestTimeoutMedium = 5 * time.Minute
 var TestTimeoutLong = 10 * time.Minute
+var NoOlmOperatorImage string
 
 var TestContext context.Context
 var testClient client.Client
@@ -165,6 +166,14 @@ func init() {
 		}
 	}
 
+	if imageNoOlm, ok := os.LookupEnv("CAMEL_K_TEST_NO_OLM_OPERATOR_IMAGE"); ok {
+		if imageNoOlm != "" {
+			NoOlmOperatorImage = imageNoOlm
+		} else {
+			fmt.Printf("Can't parse CAMEL_K_TEST_NO_OLM_OPERATOR_IMAGE. Using default value from kamel")
+		}
+	}
+
 	if value, ok := os.LookupEnv("CAMEL_K_TEST_TIMEOUT_LONG"); ok {
 		if duration, err = time.ParseDuration(value); err == nil {
 			TestTimeoutLong = duration