This is an automated email from the ASF dual-hosted git repository. tsato pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit ed98e5e6430ade52e89152ffde29a01cc88e5bb5 Author: Tadayoshi Sato <[email protected]> AuthorDate: Mon Jul 25 14:03:00 2022 +0900 fix(e2e): fix failing e2e tests --- e2e/global/common/config/config_test.go | 8 ++++---- e2e/global/common/languages/groovy_test.go | 2 +- e2e/global/common/languages/init_test_support.go | 4 ++-- e2e/global/common/languages/java_test.go | 2 +- e2e/global/common/languages/js_test.go | 2 +- e2e/global/common/languages/kotlin_test.go | 2 +- e2e/global/common/languages/xml_test.go | 2 +- e2e/global/common/languages/yaml_test.go | 2 +- e2e/global/common/operator_metrics_test.go | 2 +- e2e/global/common/traits/jvm_test.go | 2 +- e2e/global/common/traits/openapi_test.go | 2 +- e2e/namespace/install/cli/describe_test.go | 2 +- e2e/namespace/install/cli/dev_mode_test.go | 2 +- .../install/cli/duplicate_parameters_test.go | 9 +++++++-- .../install/cli/files/Java.java} | 19 +++++++++++-------- .../install/cli}/files/promote-route.groovy | 0 .../cli/files/resource-file-location-route.groovy} | 5 +++-- e2e/namespace/install/cli/global_kamelet_test.go | 5 ++--- e2e/namespace/install/cli/global_test.go | 1 + e2e/namespace/install/cli/install_test.go | 5 +++-- .../install/cli}/promote_test.go | 21 ++++++++++++--------- e2e/namespace/install/maven_http_proxy_test.go | 5 ++--- e2e/namespace/install/operator_id_filtering_test.go | 4 ++++ e2e/support/test_support.go | 6 +++--- 24 files changed, 65 insertions(+), 49 deletions(-) diff --git a/e2e/global/common/config/config_test.go b/e2e/global/common/config/config_test.go index 7dc60fe48..cda0c2990 100644 --- a/e2e/global/common/config/config_test.go +++ b/e2e/global/common/config/config_test.go @@ -73,13 +73,13 @@ func TestRunConfigExamples(t *testing.T) { // Store a configmap on the cluster var cmData = make(map[string]string) cmData["my-configmap-key"] = "my-configmap-content" - NewPlainTextConfigmap(ns, "my-cm", cmData) + CreatePlainTextConfigmap(ns, "my-cm", cmData) // Store a configmap with multiple values var cmDataMulti = make(map[string]string) cmDataMulti["my-configmap-key"] = "should-not-see-it" cmDataMulti["my-configmap-key-2"] = "my-configmap-content-2" - NewPlainTextConfigmap(ns, "my-cm-multi", cmDataMulti) + CreatePlainTextConfigmap(ns, "my-cm-multi", cmDataMulti) t.Run("Config configmap", func(t *testing.T) { Expect(KamelRunWithID(operatorID, ns, "./files/config-configmap-route.groovy", "--config", "configmap:my-cm").Execute()).To(Succeed()) @@ -123,7 +123,7 @@ func TestRunConfigExamples(t *testing.T) { // Store a configmap as property file var cmDataProps = make(map[string]string) cmDataProps["my.properties"] = "my.key.1=hello\nmy.key.2=world" - NewPlainTextConfigmap(ns, "my-cm-properties", cmDataProps) + CreatePlainTextConfigmap(ns, "my-cm-properties", cmDataProps) t.Run("Config configmap as property file", func(t *testing.T) { Expect(KamelRunWithID(operatorID, ns, "./files/config-configmap-properties-route.groovy", "--config", "configmap:my-cm-properties").Execute()).To(Succeed()) @@ -138,7 +138,7 @@ func TestRunConfigExamples(t *testing.T) { // Store a secret on the cluster var secData = make(map[string]string) secData["my-secret-key"] = "very top secret" - NewPlainTextSecret(ns, "my-sec", secData) + CreatePlainTextSecret(ns, "my-sec", secData) t.Run("Config secret", func(t *testing.T) { Expect(KamelRunWithID(operatorID, ns, "./files/config-secret-route.groovy", "--config", "secret:my-sec").Execute()).To(Succeed()) diff --git a/e2e/global/common/languages/groovy_test.go b/e2e/global/common/languages/groovy_test.go index 17f8c896a..5c35e67e3 100644 --- a/e2e/global/common/languages/groovy_test.go +++ b/e2e/global/common/languages/groovy_test.go @@ -47,7 +47,7 @@ func TestRunSimpleGroovyExamples(t *testing.T) { }) t.Run("init run groovy", func(t *testing.T) { - RunInitGeneratedExample(camelv1.LanguageGroovy, ns, t) + RunInitGeneratedExample(t, operatorID, ns, camelv1.LanguageGroovy) }) }) } diff --git a/e2e/global/common/languages/init_test_support.go b/e2e/global/common/languages/init_test_support.go index 923c0badf..ea4c66901 100644 --- a/e2e/global/common/languages/init_test_support.go +++ b/e2e/global/common/languages/init_test_support.go @@ -36,13 +36,13 @@ import ( camelv1 "github.com/apache/camel-k/pkg/apis/camel/v1" ) -func RunInitGeneratedExample(lang camelv1.Language, ns string, t *testing.T) { +func RunInitGeneratedExample(t *testing.T, operatorID string, ns string, lang camelv1.Language) { dir := util.MakeTempDir(t) itName := fmt.Sprintf("init%s", string(lang)) // e.g. initjava fileName := fmt.Sprintf("%s.%s", itName, string(lang)) // e.g. initjava.java file := path.Join(dir, fileName) Expect(Kamel("init", file).Execute()).To(Succeed()) - Expect(KamelRun(ns, file).Execute()).To(Succeed()) + Expect(KamelRunWithID(operatorID, ns, file).Execute()).To(Succeed()) Eventually(IntegrationPodPhase(ns, itName), TestTimeoutLong).Should(Equal(v1.PodRunning)) Eventually(IntegrationLogs(ns, itName), TestTimeoutShort).Should(ContainSubstring(languageInitExpectedString(lang))) Expect(Kamel("delete", "--all", "-n", ns).Execute()).To(Succeed()) diff --git a/e2e/global/common/languages/java_test.go b/e2e/global/common/languages/java_test.go index ec7efd3c1..e498b87da 100644 --- a/e2e/global/common/languages/java_test.go +++ b/e2e/global/common/languages/java_test.go @@ -55,7 +55,7 @@ func TestRunSimpleJavaExamples(t *testing.T) { }) t.Run("init run java", func(t *testing.T) { - RunInitGeneratedExample(camelv1.LanguageJavaSource, ns, t) + RunInitGeneratedExample(t, operatorID, ns, camelv1.LanguageJavaSource) }) }) } diff --git a/e2e/global/common/languages/js_test.go b/e2e/global/common/languages/js_test.go index daeaa3d7d..d7569499a 100644 --- a/e2e/global/common/languages/js_test.go +++ b/e2e/global/common/languages/js_test.go @@ -47,7 +47,7 @@ func TestRunSimpleJavaScriptExamples(t *testing.T) { }) t.Run("init run JavaScript", func(t *testing.T) { - RunInitGeneratedExample(camelv1.LanguageJavaScript, ns, t) + RunInitGeneratedExample(t, operatorID, ns, camelv1.LanguageJavaScript) }) }) } diff --git a/e2e/global/common/languages/kotlin_test.go b/e2e/global/common/languages/kotlin_test.go index 6e43a8153..69cd58a2d 100644 --- a/e2e/global/common/languages/kotlin_test.go +++ b/e2e/global/common/languages/kotlin_test.go @@ -47,7 +47,7 @@ func TestRunSimpleKotlinExamples(t *testing.T) { }) t.Run("init run Kotlin", func(t *testing.T) { - RunInitGeneratedExample(camelv1.LanguageKotlin, ns, t) + RunInitGeneratedExample(t, operatorID, ns, camelv1.LanguageKotlin) }) }) } diff --git a/e2e/global/common/languages/xml_test.go b/e2e/global/common/languages/xml_test.go index a332f0af3..04371cae4 100644 --- a/e2e/global/common/languages/xml_test.go +++ b/e2e/global/common/languages/xml_test.go @@ -47,7 +47,7 @@ func TestRunSimpleXmlExamples(t *testing.T) { }) t.Run("init run xml", func(t *testing.T) { - RunInitGeneratedExample(camelv1.LanguageXML, ns, t) + RunInitGeneratedExample(t, operatorID, ns, camelv1.LanguageXML) }) }) } diff --git a/e2e/global/common/languages/yaml_test.go b/e2e/global/common/languages/yaml_test.go index 5a754e968..3a55ac330 100644 --- a/e2e/global/common/languages/yaml_test.go +++ b/e2e/global/common/languages/yaml_test.go @@ -47,7 +47,7 @@ func TestRunSimpleYamlExamples(t *testing.T) { }) t.Run("init run yaml", func(t *testing.T) { - RunInitGeneratedExample(camelv1.LanguageYaml, ns, t) + RunInitGeneratedExample(t, operatorID, ns, camelv1.LanguageYaml) }) }) } diff --git a/e2e/global/common/operator_metrics_test.go b/e2e/global/common/operator_metrics_test.go index bd4658cb5..c0c1e9ed5 100644 --- a/e2e/global/common/operator_metrics_test.go +++ b/e2e/global/common/operator_metrics_test.go @@ -203,7 +203,7 @@ func TestMetrics(t *testing.T) { "LoggerName": Equal("camel-k.controller.integrationplatform"), "Message": Equal("Reconciling IntegrationPlatform"), "RequestNamespace": Equal(ns), - "RequestName": Equal("camel-k"), + "RequestName": Equal(operatorID), })) Expect(err).To(BeNil()) diff --git a/e2e/global/common/traits/jvm_test.go b/e2e/global/common/traits/jvm_test.go index b1ddae902..b26f46a9f 100644 --- a/e2e/global/common/traits/jvm_test.go +++ b/e2e/global/common/traits/jvm_test.go @@ -46,7 +46,7 @@ func TestJVMTrait(t *testing.T) { source, err := ioutil.ReadFile("./files/jvm/sample-1.0.jar") assert.Nil(t, err) cmData["sample-1.0.jar"] = source - err = NewBinaryConfigmap(ns, "my-deps", cmData) + err = CreateBinaryConfigmap(ns, "my-deps", cmData) assert.Nil(t, err) t.Run("JVM trait classpath", func(t *testing.T) { diff --git a/e2e/global/common/traits/openapi_test.go b/e2e/global/common/traits/openapi_test.go index 61f2d3256..d9bf91303 100644 --- a/e2e/global/common/traits/openapi_test.go +++ b/e2e/global/common/traits/openapi_test.go @@ -93,7 +93,7 @@ func TestOpenAPIConfigmap(t *testing.T) { assert.Nil(t, err) var cmDataProps = make(map[string]string) cmDataProps["petstore-api.yaml"] = string(openapiContent) - NewPlainTextConfigmap(ns, "my-openapi", cmDataProps) + CreatePlainTextConfigmap(ns, "my-openapi", cmDataProps) Expect(KamelRunWithID(operatorID, ns, "--name", "petstore", diff --git a/e2e/namespace/install/cli/describe_test.go b/e2e/namespace/install/cli/describe_test.go index b953b974a..c0fdc839d 100644 --- a/e2e/namespace/install/cli/describe_test.go +++ b/e2e/namespace/install/cli/describe_test.go @@ -70,7 +70,7 @@ func TestKamelCliDescribe(t *testing.T) { }) t.Run("Test kamel describe integration platform", func(t *testing.T) { - platform := GetOutputString(Kamel("describe", "platform", "camel-k", "-n", ns)) + platform := GetOutputString(Kamel("describe", "platform", operatorID, "-n", ns)) r, _ := regexp.Compile("(?sm).*Name:\\s+camel-k.*") Expect(platform).To(MatchRegexp(r.String())) diff --git a/e2e/namespace/install/cli/dev_mode_test.go b/e2e/namespace/install/cli/dev_mode_test.go index 5decd8849..96b8d1d1e 100644 --- a/e2e/namespace/install/cli/dev_mode_test.go +++ b/e2e/namespace/install/cli/dev_mode_test.go @@ -135,7 +135,7 @@ func TestRunDevMode(t *testing.T) { defer pipew.Close() defer piper.Close() - file := util.MakeTempCopy(t, "../config/files/resource-file-location-route.groovy") + file := util.MakeTempCopy(t, "files/resource-file-location-route.groovy") kamelRun := KamelRunWithContext(ctx, operatorID, ns, file, "--dev", "--resource", fmt.Sprintf("file:%s@/tmp/file.txt", tmpFile.Name())) kamelRun.SetOut(pipew) diff --git a/e2e/namespace/install/cli/duplicate_parameters_test.go b/e2e/namespace/install/cli/duplicate_parameters_test.go index e6c52a21c..b3a114e1b 100644 --- a/e2e/namespace/install/cli/duplicate_parameters_test.go +++ b/e2e/namespace/install/cli/duplicate_parameters_test.go @@ -40,12 +40,17 @@ func TestDuplicateParameters(t *testing.T) { // run kamel to output the traits/configuration structure in json format to check the processed values // the tracing.enabled is false inside JavaDuplicateParams.java, so we can check the output of this trait as true. - cmdParams := []string{"kamel", "run", "files/JavaDuplicateParams.java", "-o", "json", "-t", "tracing.enabled=true", "--trait", "pull-secret.enabled=true", "--property", "prop1=true", "-p", "prop2=true"} + cmdParams := []string{"kamel", "run", "files/JavaDuplicateParams.java", + "-o", "json", + "-t", "tracing.enabled=true", "--trait", "pull-secret.enabled=true", + "--property", "prop1=true", "-p", "prop2=true", + "--force"} comm, _, _ := cmd.NewKamelWithModelineCommand(ctx, cmdParams) // the command is executed inside GetOutputString function commOutput := GetOutputString(comm) - outParams := `"traits":{"affinity":{"enabled":true},"camel":{"properties":["prop1 = true","prop2 = true","foo = bar"]},"pull-secret":{"enabled":true},"addons":{"tracing":{"enabled":true}}}` + outParams := + `"traits":{"affinity":{"enabled":true},"camel":{"properties":["prop1 = true","prop2 = true","foo = bar"]},"pull-secret":{"enabled":true},"addons":{"tracing":{"enabled":true}}}` Expect(commOutput).To(ContainSubstring(outParams)) } diff --git a/e2e/global/common/files/promote-route.groovy b/e2e/namespace/install/cli/files/Java.java similarity index 74% copy from e2e/global/common/files/promote-route.groovy copy to e2e/namespace/install/cli/files/Java.java index 943a4ab91..66fef5fe8 100644 --- a/e2e/global/common/files/promote-route.groovy +++ b/e2e/namespace/install/cli/files/Java.java @@ -1,4 +1,3 @@ -// camel-k: language=groovy /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -16,10 +15,14 @@ * limitations under the License. */ -from('timer:configmap') - .setBody() - .simple("resource:classpath:my-configmap-key") - .log('configmap: ${body}') - .setBody() - .simple("resource:classpath:my-secret-key") - .log('secret: ${body}') \ No newline at end of file +import org.apache.camel.builder.RouteBuilder; + +public class Java extends RouteBuilder { + @Override + public void configure() throws Exception { + from("timer:tick") + .setHeader("m").constant("string!") + .setBody().simple("Magic${header.m}") + .log("${body}"); + } +} diff --git a/e2e/global/common/files/promote-route.groovy b/e2e/namespace/install/cli/files/promote-route.groovy similarity index 100% rename from e2e/global/common/files/promote-route.groovy rename to e2e/namespace/install/cli/files/promote-route.groovy diff --git a/e2e/global/common/files/timer-kamelet-usage.groovy b/e2e/namespace/install/cli/files/resource-file-location-route.groovy similarity index 85% rename from e2e/global/common/files/timer-kamelet-usage.groovy rename to e2e/namespace/install/cli/files/resource-file-location-route.groovy index 11ad5bb27..076a2a9c7 100644 --- a/e2e/global/common/files/timer-kamelet-usage.groovy +++ b/e2e/namespace/install/cli/files/resource-file-location-route.groovy @@ -1,3 +1,4 @@ +// camel-k: language=groovy /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -15,5 +16,5 @@ * limitations under the License. */ -from('kamelet:my-own-timer-source?message=Hello+world') - .to('log:info?showAll=false') +from('file:/tmp/?fileName=file.txt&noop=true&idempotent=false') + .log('resource file content is: ${body}') diff --git a/e2e/namespace/install/cli/global_kamelet_test.go b/e2e/namespace/install/cli/global_kamelet_test.go index b03f1d16b..6884769fe 100644 --- a/e2e/namespace/install/cli/global_kamelet_test.go +++ b/e2e/namespace/install/cli/global_kamelet_test.go @@ -47,7 +47,8 @@ func TestRunGlobalKamelet(t *testing.T) { } WithGlobalOperatorNamespace(t, func(operatorNamespace string) { - Expect(KamelInstall(operatorNamespace, "--global", "--force").Execute()).To(Succeed()) + operatorID := "camel-k-global-kamelet" + Expect(KamelInstallWithID(operatorID, operatorNamespace, "--global", "--force").Execute()).To(Succeed()) t.Run("Global operator + namespaced kamelet test", func(t *testing.T) { @@ -55,7 +56,6 @@ func TestRunGlobalKamelet(t *testing.T) { WithNewTestNamespace(t, func(ns2 string) { Expect(CreateTimerKamelet(ns2, "my-own-timer-source")()).To(Succeed()) - operatorID := "camel-k-local-ns2" Expect(KamelInstallWithID(operatorID, ns2, "--skip-operator-setup", "--olm=false").Execute()).To(Succeed()) Expect(KamelRunWithID(operatorID, ns2, "files/timer-kamelet-usage.groovy").Execute()).To(Succeed()) @@ -71,7 +71,6 @@ func TestRunGlobalKamelet(t *testing.T) { // NS3: namespace without operator WithNewTestNamespace(t, func(ns3 string) { - operatorID := "camel-k-local-ns3" Expect(KamelInstallWithID(operatorID, ns3, "--skip-operator-setup", "--olm=false").Execute()).To(Succeed()) Expect(KamelRunWithID(operatorID, ns3, "files/timer-kamelet-usage.groovy").Execute()).To(Succeed()) diff --git a/e2e/namespace/install/cli/global_test.go b/e2e/namespace/install/cli/global_test.go index f96b76b32..12943ef7a 100644 --- a/e2e/namespace/install/cli/global_test.go +++ b/e2e/namespace/install/cli/global_test.go @@ -54,6 +54,7 @@ func TestRunGlobalInstall(t *testing.T) { WithGlobalOperatorNamespace(t, func(operatorNamespace string) { Expect(KamelInstall(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 namespace local platform diff --git a/e2e/namespace/install/cli/install_test.go b/e2e/namespace/install/cli/install_test.go index 1df50622d..aee7732c9 100644 --- a/e2e/namespace/install/cli/install_test.go +++ b/e2e/namespace/install/cli/install_test.go @@ -73,9 +73,10 @@ func TestMavenRepositoryInstallation(t *testing.T) { WithNewTestNamespace(t, func(ns string) { operatorID := fmt.Sprintf("camel-k-%s", ns) Expect(KamelInstallWithID(operatorID, ns, "--maven-repository", "https://my.repo.org/public/").Execute()).To(Succeed()) - Eventually(Configmap(ns, "camel-k-maven-settings")).Should(Not(BeNil())) + configmapName := fmt.Sprintf("%s-maven-settings", operatorID) + Eventually(Configmap(ns, configmapName)).Should(Not(BeNil())) Eventually(func() string { - return Configmap(ns, "camel-k-maven-settings")().Data["settings.xml"] + return Configmap(ns, configmapName)().Data["settings.xml"] }).Should(ContainSubstring("https://my.repo.org/public/")) }) } diff --git a/e2e/global/common/promote_test.go b/e2e/namespace/install/cli/promote_test.go similarity index 88% rename from e2e/global/common/promote_test.go rename to e2e/namespace/install/cli/promote_test.go index ba9ac85e6..76ad5b62a 100644 --- a/e2e/global/common/promote_test.go +++ b/e2e/namespace/install/cli/promote_test.go @@ -36,19 +36,20 @@ import ( func TestKamelCLIPromote(t *testing.T) { // Dev environment namespace WithNewTestNamespace(t, func(nsDev string) { - Expect(KamelInstall(nsDev).Execute()).To(Succeed()) + operatorDevID := "camel-k-cli-promote-dev" + Expect(KamelInstallWithID(operatorDevID, nsDev).Execute()).To(Succeed()) // Dev content configmap var cmData = make(map[string]string) cmData["my-configmap-key"] = "I am development configmap!" - NewPlainTextConfigmap(nsDev, "my-cm", cmData) + CreatePlainTextConfigmap(nsDev, "my-cm", cmData) // Dev secret var secData = make(map[string]string) secData["my-secret-key"] = "very top secret development" - NewPlainTextSecret(nsDev, "my-sec", secData) + CreatePlainTextSecret(nsDev, "my-sec", secData) t.Run("plain integration dev", func(t *testing.T) { - Expect(KamelRun(nsDev, "./files/promote-route.groovy", + Expect(KamelRunWithID(operatorDevID, nsDev, "./files/promote-route.groovy", "--config", "configmap:my-cm", "--config", "secret:my-sec", ).Execute()).To(Succeed()) @@ -60,30 +61,32 @@ func TestKamelCLIPromote(t *testing.T) { t.Run("kamelet integration dev", func(t *testing.T) { Expect(CreateTimerKamelet(nsDev, "my-own-timer-source")()).To(Succeed()) - Expect(KamelRun(nsDev, "files/timer-kamelet-usage.groovy").Execute()).To(Succeed()) + Expect(KamelRunWithID(operatorDevID, nsDev, "./files/timer-kamelet-usage.groovy").Execute()).To(Succeed()) Eventually(IntegrationPodPhase(nsDev, "timer-kamelet-usage"), TestTimeoutMedium).Should(Equal(corev1.PodRunning)) Eventually(IntegrationLogs(nsDev, "timer-kamelet-usage"), TestTimeoutShort).Should(ContainSubstring("Hello world")) }) t.Run("kamelet binding dev", func(t *testing.T) { Expect(CreateTimerKamelet(nsDev, "kb-timer-source")()).To(Succeed()) - Expect(KamelBind(nsDev, "kb-timer-source", "log:info", "-p", "source.message=my-kamelet-binding-rocks").Execute()).To(Succeed()) + Expect(KamelBindWithID(operatorDevID, nsDev, "kb-timer-source", "log:info", "-p", "source.message=my-kamelet-binding-rocks").Execute()).To(Succeed()) Eventually(IntegrationPodPhase(nsDev, "kb-timer-source-to-log"), TestTimeoutMedium).Should(Equal(corev1.PodRunning)) Eventually(IntegrationLogs(nsDev, "kb-timer-source-to-log"), TestTimeoutShort).Should(ContainSubstring("my-kamelet-binding-rocks")) }) // Prod environment namespace WithNewTestNamespace(t, func(nsProd string) { - Expect(KamelInstall(nsProd).Execute()).To(Succeed()) + operatorProdID := "camel-k-cli-promote-prod" + Expect(KamelInstallWithID(operatorProdID, nsProd).Execute()).To(Succeed()) Eventually(PlatformPhase(nsProd), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady)) t.Run("no configmap in destination", func(t *testing.T) { Expect(Kamel("promote", "-n", nsDev, "promote-route", "--to", nsProd).Execute()).NotTo(Succeed()) }) + // Prod content configmap var cmData = make(map[string]string) cmData["my-configmap-key"] = "I am production!" - NewPlainTextConfigmap(nsProd, "my-cm", cmData) + CreatePlainTextConfigmap(nsProd, "my-cm", cmData) t.Run("no secret in destination", func(t *testing.T) { Expect(Kamel("promote", "-n", nsDev, "promote-route", "--to", nsProd).Execute()).NotTo(Succeed()) @@ -92,7 +95,7 @@ func TestKamelCLIPromote(t *testing.T) { // Prod secret var secData = make(map[string]string) secData["my-secret-key"] = "very top secret production" - NewPlainTextSecret(nsProd, "my-sec", secData) + CreatePlainTextSecret(nsProd, "my-sec", secData) t.Run("plain integration promotion", func(t *testing.T) { Expect(Kamel("promote", "-n", nsDev, "promote-route", "--to", nsProd).Execute()).To(Succeed()) diff --git a/e2e/namespace/install/maven_http_proxy_test.go b/e2e/namespace/install/maven_http_proxy_test.go index 3e0302366..06b52d676 100644 --- a/e2e/namespace/install/maven_http_proxy_test.go +++ b/e2e/namespace/install/maven_http_proxy_test.go @@ -147,6 +147,7 @@ func TestMavenProxy(t *testing.T) { noProxy = append(noProxy, svc.Spec.ClusterIPs...) // Install Camel K with the HTTP proxy + operatorID := "camel-k-maven-proxy" olm, olmErr := olm.IsAPIAvailable(TestContext, TestClient(), ns) installed, inErr := kubernetes.IsAPIResourceInstalled(TestClient(), configv1.GroupVersion.String(), reflect.TypeOf(configv1.Proxy{}).Name()) permission, pErr := kubernetes.CheckPermission(TestContext, TestClient(), configv1.GroupName, reflect.TypeOf(configv1.Proxy{}).Name(), "", "cluster", "edit") @@ -176,10 +177,8 @@ func TestMavenProxy(t *testing.T) { }() // ENV values should be injected by the OLM - operatorID := "camel-k-maven-proxy" Expect(KamelInstallWithID(operatorID, ns).Execute()).To(Succeed()) } else { - operatorID := "camel-k-maven-proxy" Expect(KamelInstallWithID(operatorID, ns, "--operator-env-vars", fmt.Sprintf("HTTP_PROXY=http://%s", hostname), // TODO: enable TLS for the HTTPS proxy when Maven supports it @@ -193,7 +192,7 @@ func TestMavenProxy(t *testing.T) { // Run the Integration name := "java" - Expect(KamelRun(ns, "files/Java.java", "--name", name).Execute()).To(Succeed()) + Expect(KamelRunWithID(operatorID, ns, "files/Java.java", "--name", name).Execute()).To(Succeed()) Eventually(IntegrationPodPhase(ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning)) Eventually(IntegrationConditionStatus(ns, name, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) diff --git a/e2e/namespace/install/operator_id_filtering_test.go b/e2e/namespace/install/operator_id_filtering_test.go index 1f8fa0b0f..45239b29f 100644 --- a/e2e/namespace/install/operator_id_filtering_test.go +++ b/e2e/namespace/install/operator_id_filtering_test.go @@ -50,6 +50,10 @@ func TestOperatorIDFiltering(t *testing.T) { } WithNewTestNamespace(t, func(ns string) { + + // Create only IntegrationPlatform so that `kamel run` with default operator ID succeeds + Expect(KamelInstall(ns, "--skip-operator-setup").Execute()).To(Succeed()) + WithNewTestNamespace(t, func(nsop1 string) { WithNewTestNamespace(t, func(nsop2 string) { operator1 := "operator-1" diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go index 2f8cbc150..1d690cfb1 100644 --- a/e2e/support/test_support.go +++ b/e2e/support/test_support.go @@ -1131,7 +1131,7 @@ func AutogeneratedConfigmapsCount(ns string) func() int { } } -func NewPlainTextConfigmap(ns string, name string, data map[string]string) error { +func CreatePlainTextConfigmap(ns string, name string, data map[string]string) error { cm := corev1.ConfigMap{ TypeMeta: metav1.TypeMeta{ Kind: "ConfigMap", @@ -1146,7 +1146,7 @@ func NewPlainTextConfigmap(ns string, name string, data map[string]string) error return TestClient().Create(TestContext, &cm) } -func NewBinaryConfigmap(ns string, name string, data map[string][]byte) error { +func CreateBinaryConfigmap(ns string, name string, data map[string][]byte) error { cm := corev1.ConfigMap{ TypeMeta: metav1.TypeMeta{ Kind: "ConfigMap", @@ -1161,7 +1161,7 @@ func NewBinaryConfigmap(ns string, name string, data map[string][]byte) error { return TestClient().Create(TestContext, &cm) } -func NewPlainTextSecret(ns string, name string, data map[string]string) error { +func CreatePlainTextSecret(ns string, name string, data map[string]string) error { sec := corev1.Secret{ TypeMeta: metav1.TypeMeta{ Kind: "Secret",
