You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by cd...@apache.org on 2024/03/08 19:36:00 UTC
(camel-k) 07/10: chore(e2e): Use separate operator instances for trait e2e tests
This is an automated email from the ASF dual-hosted git repository.
cdeppisch pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 92ea86144ab6f6d8024c1116896a4bf1797e285e
Author: Christoph Deppisch <cd...@redhat.com>
AuthorDate: Tue Mar 5 11:44:28 2024 +0100
chore(e2e): Use separate operator instances for trait e2e tests
---
e2e/advanced/synthetic_test.go | 8 +-
e2e/common/cli/bind_test.go | 3 +-
e2e/common/cli/default.go | 4 +-
e2e/common/cli/describe_test.go | 5 +-
e2e/common/{misc => cli}/main_test.go | 7 +-
e2e/common/config/config_reload_test.go | 25 +++
e2e/common/config/config_test.go | 6 +
e2e/common/config/default.go | 29 ---
e2e/common/config/kamelet_config_test.go | 260 ++++++++++++++++-------
e2e/common/config/pipe_config_test.go | 8 +
e2e/common/languages/default.go | 29 ---
e2e/common/languages/groovy_test.go | 14 +-
e2e/common/languages/java_test.go | 14 +-
e2e/common/languages/js_test.go | 14 +-
e2e/common/languages/kotlin_test.go | 14 +-
e2e/common/languages/main_test.go | 62 ------
e2e/common/languages/polyglot_test.go | 14 +-
e2e/common/languages/xml_test.go | 14 +-
e2e/common/languages/yaml_test.go | 14 +-
e2e/common/{config => }/main_test.go | 29 +--
e2e/common/misc/cron_test.go | 6 +
e2e/common/misc/default.go | 29 ---
e2e/common/misc/integration_fail_test.go | 6 +
e2e/common/misc/integration_trait_update_test.go | 6 +
e2e/common/misc/kamelet_test.go | 7 +
e2e/common/misc/kamelet_update_test.go | 6 +
e2e/common/misc/maven_repository_test.go | 7 +
e2e/common/misc/pipe_test.go | 6 +
e2e/common/misc/pipe_with_image_test.go | 7 +
e2e/common/misc/registry_maven_wagon_test.go | 194 +++++++++--------
e2e/common/misc/rest_test.go | 7 +
e2e/common/misc/scale_binding_test.go | 6 +
e2e/common/misc/scale_integration_test.go | 6 +
e2e/common/misc/structured_logs_test.go | 8 +-
e2e/common/runtimes/default.go | 28 ---
e2e/common/runtimes/runtimes_test.go | 7 +
e2e/common/traits/affinity_test.go | 6 +
e2e/common/traits/builder_test.go | 13 +-
e2e/common/traits/camel_test.go | 6 +
e2e/common/traits/container_test.go | 6 +
e2e/common/traits/default.go | 29 ---
e2e/common/traits/deployment_test.go | 13 +-
e2e/common/traits/error_handler_test.go | 6 +
e2e/common/traits/errored_trait_test.go | 6 +
e2e/common/traits/health_test.go | 6 +
e2e/common/traits/istio_test.go | 3 +-
e2e/common/traits/jolokia_test.go | 6 +
e2e/common/traits/jvm_test.go | 6 +
e2e/common/traits/kamelet_test.go | 6 +
e2e/common/traits/main_test.go | 62 ------
e2e/common/traits/master_test.go | 7 +
e2e/common/traits/openapi_test.go | 7 +
e2e/common/traits/pdb_test.go | 6 +
e2e/common/traits/pod_test.go | 6 +
e2e/common/traits/prometheus_test.go | 9 +-
e2e/common/traits/pull_secret_test.go | 6 +
e2e/common/traits/route_test.go | 10 +-
e2e/common/traits/service_binding_test.go | 6 +
e2e/common/traits/service_test.go | 7 +
e2e/common/traits/toleration_test.go | 6 +
script/Makefile | 1 +
61 files changed, 652 insertions(+), 502 deletions(-)
diff --git a/e2e/advanced/synthetic_test.go b/e2e/advanced/synthetic_test.go
index 972036019..5d8382984 100644
--- a/e2e/advanced/synthetic_test.go
+++ b/e2e/advanced/synthetic_test.go
@@ -80,14 +80,14 @@ func TestSyntheticIntegrationFromDeployment(t *testing.T) {
// Label the deployment --> Verify the Integration is created (cannot still monitor)
ExpectExecSucceed(t, g, Kubectl("label", "deploy", "my-camel-sb-svc", "camel.apache.org/integration=my-it", "-n", ns))
- g.Eventually(IntegrationPhase(t, ns, "my-it"), TestTimeoutShort).Should(Equal(v1.IntegrationPhaseRunning))
+ g.Eventually(IntegrationPhase(t, ns, "my-it"), TestTimeoutMedium).Should(Equal(v1.IntegrationPhaseRunning))
g.Eventually(IntegrationConditionStatus(t, ns, "my-it", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionFalse))
g.Eventually(IntegrationCondition(t, ns, "my-it", v1.IntegrationConditionReady), TestTimeoutShort).Should(
WithTransform(IntegrationConditionReason, Equal(v1.IntegrationConditionMonitoringPodsAvailableReason)))
// Label the deployment template --> Verify the Integration is monitored
ExpectExecSucceed(t, g, Kubectl("patch", "deployment", "my-camel-sb-svc", "--patch", `{"spec": {"template": {"metadata": {"labels": {"camel.apache.org/integration": "my-it"}}}}}`, "-n", ns))
- g.Eventually(IntegrationPhase(t, ns, "my-it"), TestTimeoutShort).Should(Equal(v1.IntegrationPhaseRunning))
+ g.Eventually(IntegrationPhase(t, ns, "my-it"), TestTimeoutMedium).Should(Equal(v1.IntegrationPhaseRunning))
g.Eventually(IntegrationConditionStatus(t, ns, "my-it", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
one := int32(1)
g.Eventually(IntegrationStatusReplicas(t, ns, "my-it"), TestTimeoutShort).Should(Equal(&one))
@@ -100,7 +100,7 @@ func TestSyntheticIntegrationFromDeployment(t *testing.T) {
ExpectExecSucceed(t, g, Kubectl("apply", "-f", "files/deploy.yaml", "-n", ns))
ExpectExecSucceed(t, g, Kubectl("label", "deploy", "my-camel-sb-svc", "camel.apache.org/integration=my-it", "-n", ns))
ExpectExecSucceed(t, g, Kubectl("patch", "deployment", "my-camel-sb-svc", "--patch", `{"spec": {"template": {"metadata": {"labels": {"camel.apache.org/integration": "my-it"}}}}}`, "-n", ns))
- g.Eventually(IntegrationPhase(t, ns, "my-it"), TestTimeoutShort).Should(Equal(v1.IntegrationPhaseRunning))
+ g.Eventually(IntegrationPhase(t, ns, "my-it"), TestTimeoutMedium).Should(Equal(v1.IntegrationPhaseRunning))
g.Eventually(IntegrationConditionStatus(t, ns, "my-it", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
g.Eventually(IntegrationStatusReplicas(t, ns, "my-it"), TestTimeoutShort).Should(Equal(&one))
@@ -110,7 +110,7 @@ func TestSyntheticIntegrationFromDeployment(t *testing.T) {
// Add label back to the deployment --> Verify the Integration is created
ExpectExecSucceed(t, g, Kubectl("label", "deploy", "my-camel-sb-svc", "camel.apache.org/integration=my-it", "-n", ns))
- g.Eventually(IntegrationPhase(t, ns, "my-it"), TestTimeoutShort).Should(Equal(v1.IntegrationPhaseRunning))
+ g.Eventually(IntegrationPhase(t, ns, "my-it"), TestTimeoutMedium).Should(Equal(v1.IntegrationPhaseRunning))
g.Eventually(IntegrationConditionStatus(t, ns, "my-it", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
g.Eventually(IntegrationStatusReplicas(t, ns, "my-it"), TestTimeoutShort).Should(Equal(&one))
// Scale the deployment --> verify replicas are correctly set
diff --git a/e2e/common/cli/bind_test.go b/e2e/common/cli/bind_test.go
index 40e1afe09..a03c984c6 100644
--- a/e2e/common/cli/bind_test.go
+++ b/e2e/common/cli/bind_test.go
@@ -46,8 +46,7 @@ func TestKamelCLIBind(t *testing.T) {
})
t.Run("unsuccessful binding, no property", func(t *testing.T) {
- opns := GetEnvOrDefault("CAMEL_K_GLOBAL_OPERATOR_NS", TestDefaultNamespace)
- g.Expect(KamelBindWithID(t, operatorID, ns, opns+"/timer-source", "log:info").Execute()).NotTo(Succeed())
+ g.Expect(KamelBindWithID(t, operatorID, ns, "timer-source", "log:info").Execute()).NotTo(Succeed())
})
t.Run("bind uris", func(t *testing.T) {
diff --git a/e2e/common/cli/default.go b/e2e/common/cli/default.go
index 74e73354d..c6174d79c 100644
--- a/e2e/common/cli/default.go
+++ b/e2e/common/cli/default.go
@@ -25,5 +25,5 @@ import (
"github.com/apache/camel-k/v2/pkg/platform"
)
-var ns = support.GetEnvOrDefault("CAMEL_K_TEST_NAMESPACE", support.TestDefaultNamespace)
-var operatorID = support.GetEnvOrDefault("CAMEL_K_OPERATOR_ID", platform.DefaultPlatformName)
+var operatorNS = support.TestDefaultNamespace + "-cli"
+var operatorID = platform.DefaultPlatformName + "-cli"
diff --git a/e2e/common/cli/describe_test.go b/e2e/common/cli/describe_test.go
index 4e175c679..656b14d98 100644
--- a/e2e/common/cli/describe_test.go
+++ b/e2e/common/cli/describe_test.go
@@ -71,11 +71,10 @@ func TestKamelCliDescribe(t *testing.T) {
})
t.Run("Test kamel describe integration platform", func(t *testing.T) {
- opns := GetEnvOrDefault("CAMEL_K_GLOBAL_OPERATOR_NS", TestDefaultNamespace)
- platform := GetOutputString(Kamel(t, "describe", "platform", operatorID, "-n", opns))
+ platform := GetOutputString(Kamel(t, "describe", "platform", operatorID, "-n", ns))
g.Expect(platform).To(ContainSubstring(fmt.Sprintf("Name: %s", operatorID)))
- r, _ := regexp.Compile("(?sm).*Namespace:\\s+" + opns + ".*")
+ r, _ := regexp.Compile("(?sm).*Namespace:\\s+" + ns + ".*")
g.Expect(platform).To(MatchRegexp(r.String()))
r, _ = regexp.Compile("(?sm).*Runtime Version:\\s+" + defaults.DefaultRuntimeVersion + ".*")
diff --git a/e2e/common/misc/main_test.go b/e2e/common/cli/main_test.go
similarity index 93%
rename from e2e/common/misc/main_test.go
rename to e2e/common/cli/main_test.go
index bf4aea736..fa9e31452 100644
--- a/e2e/common/misc/main_test.go
+++ b/e2e/common/cli/main_test.go
@@ -20,17 +20,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package misc
+package cli
import (
"fmt"
- v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
"os"
"testing"
. "github.com/onsi/gomega"
. "github.com/apache/camel-k/v2/e2e/support"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
)
func TestMain(m *testing.M) {
@@ -47,10 +47,9 @@ func TestMain(m *testing.M) {
g.Expect(TestClient(t)).ShouldNot(BeNil())
- // Install global operator for tests in this package, all tests must use this operatorID so tests can run in parallel and gain execution speed
+ // Install global operator for tests in this package, all tests must use this operatorID
g.Expect(NewNamedTestNamespace(t, operatorNS, false)).ShouldNot(BeNil())
g.Expect(CopyCamelCatalog(t, operatorNS, operatorID)).To(Succeed())
- // Need Kamelet catalog for pipe bind tests
g.Expect(KamelInstallWithIDAndKameletCatalog(t, operatorID, operatorNS, "--global", "--force").Execute()).To(Succeed())
g.Eventually(SelectedPlatformPhase(t, operatorNS, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
diff --git a/e2e/common/config/config_reload_test.go b/e2e/common/config/config_reload_test.go
index a40361f6d..cf12faa24 100644
--- a/e2e/common/config/config_reload_test.go
+++ b/e2e/common/config/config_reload_test.go
@@ -23,6 +23,7 @@ limitations under the License.
package config
import (
+ "fmt"
"strconv"
"testing"
@@ -38,6 +39,12 @@ func TestConfigmapHotReload(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-config-hot-reload"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
name := RandomizedSuffixName("config-configmap-route")
@@ -68,6 +75,12 @@ func TestConfigmapHotReload(t *testing.T) {
func TestConfigmapHotReloadDefault(t *testing.T) {
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-config-hot-reload-default"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
name := RandomizedSuffixName("config-configmap-route")
@@ -95,6 +108,12 @@ func TestConfigmapHotReloadDefault(t *testing.T) {
func TestSecretHotReload(t *testing.T) {
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-secret-hot-reload"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
name := RandomizedSuffixName("config-secret-route")
@@ -132,6 +151,12 @@ func TestConfigmapWithOwnerRefHotReload(t *testing.T) {
func CheckConfigmapWithOwnerRef(t *testing.T, hotreload bool) {
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := fmt.Sprintf("camel-k-config-owner-ref-%s", strconv.FormatBool(hotreload))
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
name := RandomizedSuffixName("config-configmap-route")
cmName := RandomizedSuffixName("my-hot-cm-")
diff --git a/e2e/common/config/config_test.go b/e2e/common/config/config_test.go
index 30fb00f3a..f8978f2bb 100644
--- a/e2e/common/config/config_test.go
+++ b/e2e/common/config/config_test.go
@@ -38,6 +38,12 @@ func TestRunConfigExamples(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-config"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("Simple property", func(t *testing.T) {
g.Expect(KamelRunWithID(t, operatorID, ns, "./files/property-route.groovy", "-p", "my.message=test-property").Execute()).To(Succeed())
diff --git a/e2e/common/config/default.go b/e2e/common/config/default.go
deleted file mode 100644
index d92514a52..000000000
--- a/e2e/common/config/default.go
+++ /dev/null
@@ -1,29 +0,0 @@
-//go:build integration
-// +build integration
-
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package config
-
-import (
- "github.com/apache/camel-k/v2/e2e/support"
- "github.com/apache/camel-k/v2/pkg/platform"
-)
-
-var operatorNS = support.TestDefaultNamespace + "-config"
-var operatorID = platform.DefaultPlatformName + "-config"
diff --git a/e2e/common/config/kamelet_config_test.go b/e2e/common/config/kamelet_config_test.go
index 8cc946cb9..e40d0f4c4 100644
--- a/e2e/common/config/kamelet_config_test.go
+++ b/e2e/common/config/kamelet_config_test.go
@@ -29,15 +29,23 @@ import (
corev1 "k8s.io/api/core/v1"
. "github.com/apache/camel-k/v2/e2e/support"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
)
// Tests on integrations with kamelets containing configuration from properties and secrets
//
// without having to change the integration code.
-func TestKameletImplicitConfigDefaultUserPropery(t *testing.T) {
+func TestKameletImplicitConfigDefaultUserProperty(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-config-kamelet-user-property"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
t.Run("run test default config using properties", func(t *testing.T) {
g.Expect(CreateTimerKamelet(t, operatorID, ns, "iconfig01-timer-source")()).To(Succeed())
@@ -59,10 +67,17 @@ func TestKameletImplicitConfigDefaultUserPropery(t *testing.T) {
}
func TestKameletImplicitConfigDefaultMountedSecret(t *testing.T) {
+ t.Parallel()
+
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-config-kamelet-secret-mount"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
- t.Run("run test default config using mounted secret", func(t *testing.T) {
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+ t.Run("run test default config using mounted secret", func(t *testing.T) {
g.Expect(CreateTimerKamelet(t, operatorID, ns, "iconfig03-timer-source")()).To(Succeed())
name := RandomizedSuffixName("iconfig-test-timer-source-int3")
@@ -91,10 +106,17 @@ func TestKameletImplicitConfigDefaultMountedSecret(t *testing.T) {
}
func TestKameletImplicitConfigDefaultMountedConfigmap(t *testing.T) {
+ t.Parallel()
+
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-config-kamelet-configmap-mount"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
- t.Run("run test default config using mounted configmap", func(t *testing.T) {
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+ t.Run("run test default config using mounted configmap", func(t *testing.T) {
g.Expect(CreateTimerKamelet(t, operatorID, ns, "iconfig04-timer-source")()).To(Succeed())
name := RandomizedSuffixName("iconfig-test-timer-source-int4")
@@ -120,8 +142,17 @@ func TestKameletImplicitConfigDefaultMountedConfigmap(t *testing.T) {
})
}
-func TestKameletImplicitConfigNamedUserPropery(t *testing.T) {
+func TestKameletImplicitConfigNamedUserProperty(t *testing.T) {
+ t.Parallel()
+
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-config-kamelet-named-property"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
t.Run("run test named config using properties", func(t *testing.T) {
g.Expect(CreateTimerKamelet(t, operatorID, ns, "iconfig05-timer-source")()).To(Succeed())
@@ -143,7 +174,16 @@ func TestKameletImplicitConfigNamedUserPropery(t *testing.T) {
}
func TestKameletImplicitConfigNamedLabeledSecret(t *testing.T) {
+ t.Parallel()
+
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-config-kamelet-secret-labeled-named"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
t.Run("run test named config using labeled secret", func(t *testing.T) {
g.Expect(CreateTimerKamelet(t, operatorID, ns, "iconfig06-timer-source")()).To(Succeed())
@@ -176,7 +216,16 @@ func TestKameletImplicitConfigNamedLabeledSecret(t *testing.T) {
}
func TestKameletImplicitConfigNamedMountedSecret(t *testing.T) {
+ t.Parallel()
+
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-config-kamelet-secret-mount-named"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
t.Run("run test named config using mounted secret", func(t *testing.T) {
g.Expect(CreateTimerKamelet(t, operatorID, ns, "iconfig07-timer-source")()).To(Succeed())
@@ -207,7 +256,16 @@ func TestKameletImplicitConfigNamedMountedSecret(t *testing.T) {
}
func TestKameletImplicitConfigNamedMountedConfigmap(t *testing.T) {
+ t.Parallel()
+
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-config-kamelet-configmap-mount-named"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
t.Run("run test named config using mounted configmap", func(t *testing.T) {
g.Expect(CreateTimerKamelet(t, operatorID, ns, "iconfig08-timer-source")()).To(Succeed())
@@ -236,7 +294,16 @@ func TestKameletImplicitConfigNamedMountedConfigmap(t *testing.T) {
}
func TestKameletImplicitConfigDefaultLabeledSecret(t *testing.T) {
+ t.Parallel()
+
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-config-kamelet-secret-labeled"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
t.Run("run test default config using labeled secret", func(t *testing.T) {
g.Expect(CreateTimerKamelet(t, operatorID, ns, "iconfig09-timer-source")()).To(Succeed())
@@ -268,8 +335,17 @@ func TestKameletImplicitConfigDefaultLabeledSecret(t *testing.T) {
// Tests on integration with kamelets containing configuration from properties and secrets with parameters inside the integration.
-func TestKameletConfigInlinedUserPropery(t *testing.T) {
+func TestKameletConfigInlinedUserProperty(t *testing.T) {
+ t.Parallel()
+
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-config-kamelet-user-property-inlined"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
t.Run("run test default config inlined properties", func(t *testing.T) {
g.Expect(CreateTimerKamelet(t, operatorID, ns, "config01-timer-source")()).To(Succeed())
g.Expect(CreateLogKamelet(t, operatorID, ns, "config01-log-sink")()).To(Succeed())
@@ -292,86 +368,122 @@ func TestKameletConfigInlinedUserPropery(t *testing.T) {
})
}
-func TestKameletConfigDefaultParamUserPropery(t *testing.T) {
- g := NewWithT(t)
- t.Run("run test default config parameters properties", func(t *testing.T) {
+func TestKameletConfigDefaultParamUserProperty(t *testing.T) {
+ t.Parallel()
+
+ WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-config-kamelet-user-property-param"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
+ t.Run("run test default config parameters properties", func(t *testing.T) {
- g.Expect(CreateTimerKamelet(t, operatorID, operatorNS, "config02-timer-source")()).To(Succeed())
- g.Expect(CreateLogKamelet(t, operatorID, operatorNS, "config02-log-sink")()).To(Succeed())
+ g.Expect(CreateTimerKamelet(t, operatorID, ns, "config02-timer-source")()).To(Succeed())
+ g.Expect(CreateLogKamelet(t, operatorID, ns, "config02-log-sink")()).To(Succeed())
- name := RandomizedSuffixName("config-test-timer-source-int2")
+ name := RandomizedSuffixName("config-test-timer-source-int2")
- g.Expect(KamelRunWithID(t, operatorID, operatorNS, "files/timer-kamelet-integration-parameters-configuration-02.yaml",
- "-p", "my-message='My parameter message 02'",
- "-p", "my-logger='myIntegrationLogger02'",
- "--name", name).Execute()).To(Succeed())
- g.Eventually(IntegrationPodPhase(t, operatorNS, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationLogs(t, operatorNS, name)).Should(ContainSubstring("My parameter message 02"))
- g.Eventually(IntegrationLogs(t, operatorNS, name)).Should(ContainSubstring("myIntegrationLogger02"))
+ g.Expect(KamelRunWithID(t, operatorID, ns, "files/timer-kamelet-integration-parameters-configuration-02.yaml",
+ "-p", "my-message='My parameter message 02'",
+ "-p", "my-logger='myIntegrationLogger02'",
+ "--name", name).Execute()).To(Succeed())
+ g.Eventually(IntegrationPodPhase(t, ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationLogs(t, ns, name)).Should(ContainSubstring("My parameter message 02"))
+ g.Eventually(IntegrationLogs(t, ns, name)).Should(ContainSubstring("myIntegrationLogger02"))
+
+ g.Expect(Kamel(t, "delete", name, "-n", ns).Execute()).To(Succeed())
+ g.Eventually(Integration(t, ns, name), TestTimeoutLong).Should(BeNil())
+ g.Expect(DeleteKamelet(t, ns, "config02-timer-source")).To(Succeed())
+ g.Expect(DeleteKamelet(t, ns, "config02-log-sink")).To(Succeed())
+ })
- g.Expect(Kamel(t, "delete", name, "-n", operatorNS).Execute()).To(Succeed())
- g.Eventually(Integration(t, operatorNS, name), TestTimeoutLong).Should(BeNil())
- g.Expect(DeleteKamelet(t, operatorNS, "config02-timer-source")).To(Succeed())
- g.Expect(DeleteKamelet(t, operatorNS, "config02-log-sink")).To(Succeed())
+ g.Expect(Kamel(t, "delete", "--all", "-n", ns).Execute()).To(Succeed())
})
}
func TestKameletConfigDefaultParamMountedSecret(t *testing.T) {
- g := NewWithT(t)
- t.Run("run test default config secret properties", func(t *testing.T) {
-
- g.Expect(CreateTimerKamelet(t, operatorID, operatorNS, "config03-timer-source")()).To(Succeed())
- g.Expect(CreateLogKamelet(t, operatorID, operatorNS, "config03-log-sink")()).To(Succeed())
-
- name := RandomizedSuffixName("config-test-timer-source-int3")
- secretName := "my-config-int3-secret"
-
- var secData = make(map[string]string)
- secData["my-message"] = "My secret message 03"
- secData["my-logger"] = "mySecretIntegrationLogger03"
- g.Expect(CreatePlainTextSecret(t, operatorNS, secretName, secData)).To(Succeed())
-
- g.Expect(KamelRunWithID(t, operatorID, operatorNS, "files/timer-kamelet-integration-parameters-configuration-03.yaml",
- "-t", "mount.configs=secret:"+secretName,
- "--name", name).Execute()).To(Succeed())
- g.Eventually(IntegrationPodPhase(t, operatorNS, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationLogs(t, operatorNS, name)).Should(ContainSubstring("My secret message 03"))
- g.Eventually(IntegrationLogs(t, operatorNS, name)).Should(ContainSubstring("mySecretIntegrationLogger03"))
-
- g.Expect(Kamel(t, "delete", name, "-n", operatorNS).Execute()).To(Succeed())
- g.Eventually(Integration(t, operatorNS, name), TestTimeoutLong).Should(BeNil())
- g.Expect(DeleteSecret(t, operatorNS, secretName)).To(Succeed())
- g.Expect(DeleteKamelet(t, operatorNS, "config03-timer-source")).To(Succeed())
- g.Expect(DeleteKamelet(t, operatorNS, "config03-log-sink")).To(Succeed())
+ t.Parallel()
+
+ WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-config-kamelet-secret-mount-param"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
+ t.Run("run test default config secret properties", func(t *testing.T) {
+
+ g.Expect(CreateTimerKamelet(t, operatorID, ns, "config03-timer-source")()).To(Succeed())
+ g.Expect(CreateLogKamelet(t, operatorID, ns, "config03-log-sink")()).To(Succeed())
+
+ name := RandomizedSuffixName("config-test-timer-source-int3")
+ secretName := "my-config-int3-secret"
+
+ var secData = make(map[string]string)
+ secData["my-message"] = "My secret message 03"
+ secData["my-logger"] = "mySecretIntegrationLogger03"
+ g.Expect(CreatePlainTextSecret(t, ns, secretName, secData)).To(Succeed())
+
+ g.Expect(KamelRunWithID(t, operatorID, ns, "files/timer-kamelet-integration-parameters-configuration-03.yaml",
+ "-t", "mount.configs=secret:"+secretName,
+ "--name", name).Execute()).To(Succeed())
+ g.Eventually(IntegrationPodPhase(t, ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationLogs(t, ns, name)).Should(ContainSubstring("My secret message 03"))
+ g.Eventually(IntegrationLogs(t, ns, name)).Should(ContainSubstring("mySecretIntegrationLogger03"))
+
+ g.Expect(Kamel(t, "delete", name, "-n", ns).Execute()).To(Succeed())
+ g.Eventually(Integration(t, ns, name), TestTimeoutLong).Should(BeNil())
+ g.Expect(DeleteSecret(t, ns, secretName)).To(Succeed())
+ g.Expect(DeleteKamelet(t, ns, "config03-timer-source")).To(Succeed())
+ g.Expect(DeleteKamelet(t, ns, "config03-log-sink")).To(Succeed())
+ })
+
+ g.Expect(Kamel(t, "delete", "--all", "-n", ns).Execute()).To(Succeed())
})
}
func TestKameletConfigDefaultParamMountedConfigmap(t *testing.T) {
- g := NewWithT(t)
- t.Run("run test default config configmap properties", func(t *testing.T) {
-
- g.Expect(CreateTimerKamelet(t, operatorID, operatorNS, "config04-timer-source")()).To(Succeed())
- g.Expect(CreateLogKamelet(t, operatorID, operatorNS, "config04-log-sink")()).To(Succeed())
-
- name := RandomizedSuffixName("config-test-timer-source-int4")
- cmName := "my-config-int4-configmap"
-
- var cmData = make(map[string]string)
- cmData["my-message"] = "My configmap message 04"
- cmData["my-logger"] = "myConfigmapIntegrationLogger04"
- g.Expect(CreatePlainTextConfigmap(t, operatorNS, cmName, cmData)).To(Succeed())
-
- g.Expect(KamelRunWithID(t, operatorID, operatorNS, "files/timer-kamelet-integration-parameters-configuration-04.yaml",
- "-t", "mount.configs=configmap:"+cmName,
- "--name", name).Execute()).To(Succeed())
- g.Eventually(IntegrationPodPhase(t, operatorNS, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationLogs(t, operatorNS, name)).Should(ContainSubstring("My configmap message 04"))
- g.Eventually(IntegrationLogs(t, operatorNS, name)).Should(ContainSubstring("myConfigmapIntegrationLogger04"))
-
- g.Expect(Kamel(t, "delete", name, "-n", operatorNS).Execute()).To(Succeed())
- g.Eventually(Integration(t, operatorNS, name), TestTimeoutLong).Should(BeNil())
- g.Expect(DeleteConfigmap(t, operatorNS, cmName)).To(Succeed())
- g.Expect(DeleteKamelet(t, operatorNS, "config04-timer-source")).To(Succeed())
- g.Expect(DeleteKamelet(t, operatorNS, "config04-log-sink")).To(Succeed())
+ t.Parallel()
+
+ WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-config-kamelet-configmap-mount-param"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
+ t.Run("run test default config configmap properties", func(t *testing.T) {
+
+ g.Expect(CreateTimerKamelet(t, operatorID, ns, "config04-timer-source")()).To(Succeed())
+ g.Expect(CreateLogKamelet(t, operatorID, ns, "config04-log-sink")()).To(Succeed())
+
+ name := RandomizedSuffixName("config-test-timer-source-int4")
+ cmName := "my-config-int4-configmap"
+
+ var cmData = make(map[string]string)
+ cmData["my-message"] = "My configmap message 04"
+ cmData["my-logger"] = "myConfigmapIntegrationLogger04"
+ g.Expect(CreatePlainTextConfigmap(t, ns, cmName, cmData)).To(Succeed())
+
+ g.Expect(KamelRunWithID(t, operatorID, ns, "files/timer-kamelet-integration-parameters-configuration-04.yaml",
+ "-t", "mount.configs=configmap:"+cmName,
+ "--name", name).Execute()).To(Succeed())
+ g.Eventually(IntegrationPodPhase(t, ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationLogs(t, ns, name)).Should(ContainSubstring("My configmap message 04"))
+ g.Eventually(IntegrationLogs(t, ns, name)).Should(ContainSubstring("myConfigmapIntegrationLogger04"))
+
+ g.Expect(Kamel(t, "delete", name, "-n", ns).Execute()).To(Succeed())
+ g.Eventually(Integration(t, ns, name), TestTimeoutLong).Should(BeNil())
+ g.Expect(DeleteConfigmap(t, ns, cmName)).To(Succeed())
+ g.Expect(DeleteKamelet(t, ns, "config04-timer-source")).To(Succeed())
+ g.Expect(DeleteKamelet(t, ns, "config04-log-sink")).To(Succeed())
+ })
+
+ g.Expect(Kamel(t, "delete", "--all", "-n", ns).Execute()).To(Succeed())
})
}
diff --git a/e2e/common/config/pipe_config_test.go b/e2e/common/config/pipe_config_test.go
index 272ed84de..220b7cf53 100644
--- a/e2e/common/config/pipe_config_test.go
+++ b/e2e/common/config/pipe_config_test.go
@@ -29,6 +29,7 @@ import (
corev1 "k8s.io/api/core/v1"
. "github.com/apache/camel-k/v2/e2e/support"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
)
// Tests on pipe with kamelets containing configuration from properties and secrets.
@@ -36,6 +37,13 @@ func TestPipeConfig(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-config"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
t.Run("test custom source/sink pipe", func(t *testing.T) {
g.Expect(CreateTimerKamelet(t, operatorID, ns, "my-pipe-timer-source")()).To(Succeed())
g.Expect(CreateLogKamelet(t, operatorID, ns, "my-pipe-log-sink")()).To(Succeed())
diff --git a/e2e/common/languages/default.go b/e2e/common/languages/default.go
deleted file mode 100644
index 2a7e2e176..000000000
--- a/e2e/common/languages/default.go
+++ /dev/null
@@ -1,29 +0,0 @@
-//go:build integration
-// +build integration
-
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package languages
-
-import (
- "github.com/apache/camel-k/v2/e2e/support"
- "github.com/apache/camel-k/v2/pkg/platform"
-)
-
-var operatorNS = support.TestDefaultNamespace + "-languages"
-var operatorID = platform.DefaultPlatformName + "-languages"
diff --git a/e2e/common/languages/groovy_test.go b/e2e/common/languages/groovy_test.go
index 896a1c563..02bcf7253 100644
--- a/e2e/common/languages/groovy_test.go
+++ b/e2e/common/languages/groovy_test.go
@@ -27,21 +27,27 @@ import (
. "github.com/onsi/gomega"
- v1 "k8s.io/api/core/v1"
+ corev1 "k8s.io/api/core/v1"
. "github.com/apache/camel-k/v2/e2e/support"
- camelv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
)
func TestRunSimpleGroovyExamples(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-runtimes-groovy"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("run groovy", func(t *testing.T) {
g.Expect(KamelRunWithID(t, operatorID, ns, "files/groovy.groovy").Execute()).To(Succeed())
- g.Eventually(IntegrationPodPhase(t, ns, "groovy"), TestTimeoutLong).Should(Equal(v1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, ns, "groovy", camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue))
+ g.Eventually(IntegrationPodPhase(t, ns, "groovy"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationConditionStatus(t, ns, "groovy", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
g.Eventually(IntegrationLogs(t, ns, "groovy"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
})
diff --git a/e2e/common/languages/java_test.go b/e2e/common/languages/java_test.go
index f631b985c..9e2ee0e4d 100644
--- a/e2e/common/languages/java_test.go
+++ b/e2e/common/languages/java_test.go
@@ -27,21 +27,27 @@ import (
. "github.com/onsi/gomega"
- v1 "k8s.io/api/core/v1"
+ corev1 "k8s.io/api/core/v1"
. "github.com/apache/camel-k/v2/e2e/support"
- camelv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
)
func TestRunSimpleJavaExamples(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-runtimes-java"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("run java", func(t *testing.T) {
g.Expect(KamelRunWithID(t, operatorID, ns, "files/Java.java").Execute()).To(Succeed())
- g.Eventually(IntegrationPodPhase(t, ns, "java"), TestTimeoutLong).Should(Equal(v1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, ns, "java", camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue))
+ g.Eventually(IntegrationPodPhase(t, ns, "java"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationConditionStatus(t, ns, "java", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
g.Eventually(IntegrationLogs(t, ns, "java"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
})
diff --git a/e2e/common/languages/js_test.go b/e2e/common/languages/js_test.go
index ccdcbc465..4a0218156 100644
--- a/e2e/common/languages/js_test.go
+++ b/e2e/common/languages/js_test.go
@@ -27,21 +27,27 @@ import (
. "github.com/onsi/gomega"
- v1 "k8s.io/api/core/v1"
+ corev1 "k8s.io/api/core/v1"
. "github.com/apache/camel-k/v2/e2e/support"
- camelv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
)
func TestRunSimpleJavaScriptExamples(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-runtimes-js"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("run js", func(t *testing.T) {
g.Expect(KamelRunWithID(t, operatorID, ns, "files/js.js").Execute()).To(Succeed())
- g.Eventually(IntegrationPodPhase(t, ns, "js"), TestTimeoutLong).Should(Equal(v1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, ns, "js", camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue))
+ g.Eventually(IntegrationPodPhase(t, ns, "js"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationConditionStatus(t, ns, "js", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
g.Eventually(IntegrationLogs(t, ns, "js"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
})
diff --git a/e2e/common/languages/kotlin_test.go b/e2e/common/languages/kotlin_test.go
index 5999058d6..190d76cde 100644
--- a/e2e/common/languages/kotlin_test.go
+++ b/e2e/common/languages/kotlin_test.go
@@ -27,21 +27,27 @@ import (
. "github.com/onsi/gomega"
- v1 "k8s.io/api/core/v1"
+ corev1 "k8s.io/api/core/v1"
. "github.com/apache/camel-k/v2/e2e/support"
- camelv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
)
func TestRunSimpleKotlinExamples(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-runtimes-kotlin"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("run kotlin", func(t *testing.T) {
g.Expect(KamelRunWithID(t, operatorID, ns, "files/kotlin.kts").Execute()).To(Succeed())
- g.Eventually(IntegrationPodPhase(t, ns, "kotlin"), TestTimeoutLong).Should(Equal(v1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, ns, "kotlin", camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue))
+ g.Eventually(IntegrationPodPhase(t, ns, "kotlin"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationConditionStatus(t, ns, "kotlin", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
g.Eventually(IntegrationLogs(t, ns, "kotlin"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
})
diff --git a/e2e/common/languages/main_test.go b/e2e/common/languages/main_test.go
deleted file mode 100644
index 10800b385..000000000
--- a/e2e/common/languages/main_test.go
+++ /dev/null
@@ -1,62 +0,0 @@
-//go:build integration
-// +build integration
-
-// To enable compilation of this file in Goland, go to "Settings -> Go -> Vendoring & Build Tags -> Custom Tags" and add "integration"
-
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package languages
-
-import (
- "fmt"
- v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
- "os"
- "testing"
-
- . "github.com/onsi/gomega"
-
- . "github.com/apache/camel-k/v2/e2e/support"
-)
-
-func TestMain(m *testing.M) {
- justCompile := GetEnvOrDefault("CAMEL_K_E2E_JUST_COMPILE", "false")
- if justCompile == "true" {
- os.Exit(m.Run())
- }
-
- g := NewGomega(func(message string, callerSkip ...int) {
- fmt.Printf("Test setup failed! - %s\n", message)
- })
-
- var t *testing.T
-
- g.Expect(TestClient(t)).ShouldNot(BeNil())
-
- // Install global operator for tests in this package, all tests must use this operatorID so tests can run in parallel and gain execution speed
- g.Expect(NewNamedTestNamespace(t, operatorNS, false)).ShouldNot(BeNil())
- g.Expect(CopyCamelCatalog(t, operatorNS, operatorID)).To(Succeed())
- g.Expect(KamelInstallWithID(t, operatorID, operatorNS, "--global", "--force").Execute()).To(Succeed())
- g.Eventually(SelectedPlatformPhase(t, operatorNS, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
-
- exitCode := m.Run()
-
- g.Expect(UninstallFromNamespace(t, operatorNS))
- g.Expect(DeleteNamespace(t, operatorNS)).To(Succeed())
-
- os.Exit(exitCode)
-}
diff --git a/e2e/common/languages/polyglot_test.go b/e2e/common/languages/polyglot_test.go
index 0b4c52084..d52f79c4c 100644
--- a/e2e/common/languages/polyglot_test.go
+++ b/e2e/common/languages/polyglot_test.go
@@ -27,21 +27,27 @@ import (
. "github.com/onsi/gomega"
- v1 "k8s.io/api/core/v1"
+ corev1 "k8s.io/api/core/v1"
. "github.com/apache/camel-k/v2/e2e/support"
- camelv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
)
func TestRunPolyglotExamples(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-runtimes-polyglot"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("run polyglot", func(t *testing.T) {
g.Expect(KamelRunWithID(t, operatorID, ns, "--name", "polyglot", "files/js-polyglot.js", "files/yaml-polyglot.yaml").Execute()).To(Succeed())
- g.Eventually(IntegrationPodPhase(t, ns, "polyglot"), TestTimeoutLong).Should(Equal(v1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, ns, "polyglot", camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue))
+ g.Eventually(IntegrationPodPhase(t, ns, "polyglot"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationConditionStatus(t, ns, "polyglot", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
g.Eventually(IntegrationLogs(t, ns, "polyglot"), TestTimeoutShort).Should(ContainSubstring("Magicpolyglot-yaml"))
g.Eventually(IntegrationLogs(t, ns, "polyglot"), TestTimeoutShort).Should(ContainSubstring("Magicpolyglot-js"))
})
diff --git a/e2e/common/languages/xml_test.go b/e2e/common/languages/xml_test.go
index a4f9accd4..53ee19bbe 100644
--- a/e2e/common/languages/xml_test.go
+++ b/e2e/common/languages/xml_test.go
@@ -27,21 +27,27 @@ import (
. "github.com/onsi/gomega"
- v1 "k8s.io/api/core/v1"
+ corev1 "k8s.io/api/core/v1"
. "github.com/apache/camel-k/v2/e2e/support"
- camelv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
)
func TestRunSimpleXmlExamples(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-runtimes-xml"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("run xml", func(t *testing.T) {
g.Expect(KamelRunWithID(t, operatorID, ns, "files/xml.xml").Execute()).To(Succeed())
- g.Eventually(IntegrationPodPhase(t, ns, "xml"), TestTimeoutLong).Should(Equal(v1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, ns, "xml", camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue))
+ g.Eventually(IntegrationPodPhase(t, ns, "xml"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationConditionStatus(t, ns, "xml", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
g.Eventually(IntegrationLogs(t, ns, "xml"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
})
diff --git a/e2e/common/languages/yaml_test.go b/e2e/common/languages/yaml_test.go
index 107e32209..a78465c6e 100644
--- a/e2e/common/languages/yaml_test.go
+++ b/e2e/common/languages/yaml_test.go
@@ -27,21 +27,27 @@ import (
. "github.com/onsi/gomega"
- v1 "k8s.io/api/core/v1"
+ corev1 "k8s.io/api/core/v1"
. "github.com/apache/camel-k/v2/e2e/support"
- camelv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
)
func TestRunSimpleYamlExamples(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-runtimes-yaml"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("run yaml", func(t *testing.T) {
g.Expect(KamelRunWithID(t, operatorID, ns, "files/yaml.yaml").Execute()).To(Succeed())
- g.Eventually(IntegrationPodPhase(t, ns, "yaml"), TestTimeoutLong).Should(Equal(v1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, ns, "yaml", camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue))
+ g.Eventually(IntegrationPodPhase(t, ns, "yaml"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationConditionStatus(t, ns, "yaml", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
g.Eventually(IntegrationLogs(t, ns, "yaml"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
})
diff --git a/e2e/common/config/main_test.go b/e2e/common/main_test.go
similarity index 56%
rename from e2e/common/config/main_test.go
rename to e2e/common/main_test.go
index 1f977eab9..ff84d996c 100644
--- a/e2e/common/config/main_test.go
+++ b/e2e/common/main_test.go
@@ -20,17 +20,19 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-package config
+package common
import (
"fmt"
- v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
"os"
"testing"
. "github.com/onsi/gomega"
+ corev1 "k8s.io/api/core/v1"
. "github.com/apache/camel-k/v2/e2e/support"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
+ "github.com/apache/camel-k/v2/pkg/platform"
)
func TestMain(m *testing.M) {
@@ -39,6 +41,9 @@ func TestMain(m *testing.M) {
os.Exit(m.Run())
}
+ operatorID := platform.DefaultPlatformName
+ ns := GetEnvOrDefault("CAMEL_K_GLOBAL_OPERATOR_NS", TestDefaultNamespace)
+
g := NewGomega(func(message string, callerSkip ...int) {
fmt.Printf("Test setup failed! - %s\n", message)
})
@@ -46,17 +51,15 @@ func TestMain(m *testing.M) {
var t *testing.T
g.Expect(TestClient(t)).ShouldNot(BeNil())
+ g.Expect(KamelRunWithID(t, operatorID, ns, "languages/files/Java.java").Execute()).To(Succeed())
+ g.Eventually(IntegrationPodPhase(t, ns, "java"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationConditionStatus(t, ns, "java", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
+ g.Eventually(IntegrationLogs(t, ns, "java"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
- // Install global operator for tests in this package, all tests must use this operatorID so tests can run in parallel and gain execution speed
- g.Expect(NewNamedTestNamespace(t, operatorNS, false)).ShouldNot(BeNil())
- g.Expect(CopyCamelCatalog(t, operatorNS, operatorID)).To(Succeed())
- g.Expect(KamelInstallWithID(t, operatorID, operatorNS, "--global", "--force").Execute()).To(Succeed())
- g.Eventually(SelectedPlatformPhase(t, operatorNS, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
-
- exitCode := m.Run()
-
- g.Expect(UninstallFromNamespace(t, operatorNS))
- g.Expect(DeleteNamespace(t, operatorNS)).To(Succeed())
+ g.Expect(KamelRunWithID(t, operatorID, ns, "languages/files/yaml.yaml").Execute()).To(Succeed())
+ g.Eventually(IntegrationPodPhase(t, ns, "yaml"), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationConditionStatus(t, ns, "yaml", v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
+ g.Eventually(IntegrationLogs(t, ns, "yaml"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
- os.Exit(exitCode)
+ os.Exit(m.Run())
}
diff --git a/e2e/common/misc/cron_test.go b/e2e/common/misc/cron_test.go
index fea57d999..de2abf7ef 100644
--- a/e2e/common/misc/cron_test.go
+++ b/e2e/common/misc/cron_test.go
@@ -37,6 +37,12 @@ func TestRunCronExample(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-cron"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("cron", func(t *testing.T) {
g.Expect(KamelRunWithID(t, operatorID, ns, "files/cron.yaml").Execute()).To(Succeed())
diff --git a/e2e/common/misc/default.go b/e2e/common/misc/default.go
deleted file mode 100644
index 9e677ac69..000000000
--- a/e2e/common/misc/default.go
+++ /dev/null
@@ -1,29 +0,0 @@
-//go:build integration
-// +build integration
-
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package misc
-
-import (
- "github.com/apache/camel-k/v2/e2e/support"
- "github.com/apache/camel-k/v2/pkg/platform"
-)
-
-var operatorNS = support.TestDefaultNamespace + "-misc"
-var operatorID = platform.DefaultPlatformName + "-misc"
diff --git a/e2e/common/misc/integration_fail_test.go b/e2e/common/misc/integration_fail_test.go
index 8b8b03df2..73f2223d1 100644
--- a/e2e/common/misc/integration_fail_test.go
+++ b/e2e/common/misc/integration_fail_test.go
@@ -38,6 +38,12 @@ func TestBadRouteIntegration(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-bad-route"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("run bad java route", func(t *testing.T) {
name := RandomizedSuffixName("bad-route")
diff --git a/e2e/common/misc/integration_trait_update_test.go b/e2e/common/misc/integration_trait_update_test.go
index 4a8b7a374..5a4be2dfe 100644
--- a/e2e/common/misc/integration_trait_update_test.go
+++ b/e2e/common/misc/integration_trait_update_test.go
@@ -37,6 +37,12 @@ func TestTraitUpdates(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-trait-update"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("run and update trait", func(t *testing.T) {
name := RandomizedSuffixName("yaml-route")
diff --git a/e2e/common/misc/kamelet_test.go b/e2e/common/misc/kamelet_test.go
index dcad2be56..a71b60a10 100644
--- a/e2e/common/misc/kamelet_test.go
+++ b/e2e/common/misc/kamelet_test.go
@@ -30,12 +30,19 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
. "github.com/apache/camel-k/v2/e2e/support"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
)
func TestKameletClasspathLoading(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-kamelet-loading"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
// Store a configmap on the cluster
var cmData = make(map[string]string)
diff --git a/e2e/common/misc/kamelet_update_test.go b/e2e/common/misc/kamelet_update_test.go
index faf251b42..10d9ec9f7 100644
--- a/e2e/common/misc/kamelet_update_test.go
+++ b/e2e/common/misc/kamelet_update_test.go
@@ -38,6 +38,12 @@ func TestBundleKameletUpdate(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-kamelet-bundle"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
g.Expect(createBundleKamelet(t, operatorID, ns, "my-http-sink")()).To(Succeed()) // Going to be replaced
g.Expect(createUserKamelet(t, operatorID, ns, "user-sink")()).To(Succeed()) // Left intact by the operator
diff --git a/e2e/common/misc/maven_repository_test.go b/e2e/common/misc/maven_repository_test.go
index c51e629bb..9f57b9efb 100644
--- a/e2e/common/misc/maven_repository_test.go
+++ b/e2e/common/misc/maven_repository_test.go
@@ -37,6 +37,13 @@ func TestRunExtraRepository(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-extra-repository"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
name := RandomizedSuffixName("java")
g.Expect(KamelRunWithID(t, operatorID, ns, "files/Java.java",
"--maven-repository", "https://maven.repository.redhat.com/ga@id=redhat",
diff --git a/e2e/common/misc/pipe_test.go b/e2e/common/misc/pipe_test.go
index ab143b47f..5d97ed3a3 100644
--- a/e2e/common/misc/pipe_test.go
+++ b/e2e/common/misc/pipe_test.go
@@ -38,6 +38,12 @@ func TestPipe(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-pipe"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
// Error Handler testing
t.Run("test error handler", func(t *testing.T) {
diff --git a/e2e/common/misc/pipe_with_image_test.go b/e2e/common/misc/pipe_with_image_test.go
index aaf58b571..59bbe2277 100644
--- a/e2e/common/misc/pipe_with_image_test.go
+++ b/e2e/common/misc/pipe_with_image_test.go
@@ -31,12 +31,19 @@ import (
corev1 "k8s.io/api/core/v1"
. "github.com/apache/camel-k/v2/e2e/support"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
)
func TestPipeWithImage(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-pipe-image"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
bindingID := "with-image-binding"
diff --git a/e2e/common/misc/registry_maven_wagon_test.go b/e2e/common/misc/registry_maven_wagon_test.go
index 6a13787c3..2d93ce51e 100644
--- a/e2e/common/misc/registry_maven_wagon_test.go
+++ b/e2e/common/misc/registry_maven_wagon_test.go
@@ -39,7 +39,6 @@ import (
func TestImageRegistryIsAMavenRepository(t *testing.T) {
t.Parallel()
- g := NewWithT(t)
ocp, err := openshift.IsOpenShift(TestClient(t))
require.NoError(t, err)
@@ -48,97 +47,106 @@ func TestImageRegistryIsAMavenRepository(t *testing.T) {
return
}
- t.Run("image registry is a maven repository", func(t *testing.T) {
- // Create integration that should decrypt an encrypted message to "foobar" and log it
- name := RandomizedSuffixName("foobar-decryption")
- jar, err := filepath.Abs("files/registry/sample-decryption-1.0.jar?skipPOM=true")
- require.NoError(t, err)
- pom, err := filepath.Abs("files/registry/sample-decryption-1.0.pom")
- require.NoError(t, err)
-
- g.Expect(KamelRunWithID(t, operatorID, operatorNS, "files/registry/FoobarDecryption.java",
- "--name", name,
- "-d", fmt.Sprintf("file://%s", jar),
- "-d", fmt.Sprintf("file://%s", pom),
- ).Execute()).To(Succeed())
-
- g.Eventually(IntegrationPodPhase(t, operatorNS, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, operatorNS, name, v1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(corev1.ConditionTrue))
- g.Eventually(IntegrationLogs(t, operatorNS, name), TestTimeoutShort).Should(ContainSubstring("foobar"))
+ WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-rest"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
+ t.Run("image registry is a maven repository", func(t *testing.T) {
+ // Create integration that should decrypt an encrypted message to "foobar" and log it
+ name := RandomizedSuffixName("foobar-decryption")
+ jar, err := filepath.Abs("files/registry/sample-decryption-1.0.jar?skipPOM=true")
+ require.NoError(t, err)
+ pom, err := filepath.Abs("files/registry/sample-decryption-1.0.pom")
+ require.NoError(t, err)
+
+ g.Expect(KamelRunWithID(t, operatorID, ns, "files/registry/FoobarDecryption.java",
+ "--name", name,
+ "-d", fmt.Sprintf("file://%s", jar),
+ "-d", fmt.Sprintf("file://%s", pom),
+ ).Execute()).To(Succeed())
+
+ g.Eventually(IntegrationPodPhase(t, ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationConditionStatus(t, ns, name, v1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(corev1.ConditionTrue))
+ g.Eventually(IntegrationLogs(t, ns, name), TestTimeoutShort).Should(ContainSubstring("foobar"))
+ })
+
+ t.Run("local files are mounted in the integration container at the default path", func(t *testing.T) {
+ name := RandomizedSuffixName("laughing-route-default-path")
+
+ g.Expect(KamelRunWithID(t, operatorID, ns, "files/registry/LaughingRoute.java",
+ "--name", name,
+ "-p", "location=/deployments/?filename=laugh.txt",
+ "-d", "file://files/registry/laugh.txt",
+ ).Execute()).To(Succeed())
+
+ g.Eventually(IntegrationPodPhase(t, ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationConditionStatus(t, ns, name, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
+ g.Eventually(IntegrationLogs(t, ns, name), TestTimeoutShort).Should(ContainSubstring("haha"))
+ })
+
+ t.Run("local files are mounted in the integration container at a custom path", func(t *testing.T) {
+ name := RandomizedSuffixName("laughing-route-custom-path")
+ customPath := "this/is/a/custom/path/"
+
+ g.Expect(KamelRunWithID(t, operatorID, ns, "files/registry/LaughingRoute.java",
+ "--name", name,
+ "-p", fmt.Sprintf("location=%s", customPath),
+ "-d", fmt.Sprintf("file://files/registry/laugh.txt?targetPath=%slaugh.txt", customPath),
+ ).Execute()).To(Succeed())
+
+ g.Eventually(IntegrationPodPhase(t, ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationConditionStatus(t, ns, name, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
+ g.Eventually(IntegrationLogs(t, ns, name), TestTimeoutShort).Should(ContainSubstring("haha"))
+ })
+
+ t.Run("local directory is mounted in the integration container", func(t *testing.T) {
+ name := RandomizedSuffixName("laughing-route-directory")
+
+ g.Expect(KamelRunWithID(t, operatorID, ns, "files/registry/LaughingRoute.java",
+ "--name", name,
+ "-p", "location=files/registry/",
+ "-d", fmt.Sprintf("file://files/registry/laughs/?targetPath=files/registry/"),
+ ).Execute()).To(Succeed())
+
+ g.Eventually(IntegrationPodPhase(t, ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationConditionStatus(t, ns, name, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
+ g.Eventually(IntegrationLogs(t, ns, name), TestTimeoutShort).Should(ContainSubstring("haha"))
+ g.Eventually(IntegrationLogs(t, ns, name), TestTimeoutShort).Should(ContainSubstring("hehe"))
+ })
+
+ t.Run("pom file is extracted from JAR", func(t *testing.T) {
+ // Create integration that should decrypt foobar and log it
+ name := RandomizedSuffixName("foobar-decryption-pom-extraction")
+ jar, err := filepath.Abs("files/registry/sample-decryption-1.0.jar")
+ require.NoError(t, err)
+
+ g.Expect(KamelRunWithID(t, operatorID, ns, "files/registry/FoobarDecryption.java",
+ "--name", name,
+ "-d", fmt.Sprintf("file://%s", jar),
+ ).Execute()).To(Succeed())
+
+ g.Eventually(IntegrationPodPhase(t, ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationConditionStatus(t, ns, name, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
+ g.Eventually(IntegrationLogs(t, ns, name), TestTimeoutShort).Should(ContainSubstring("foobar"))
+ })
+
+ t.Run("dependency can be used at build time", func(t *testing.T) {
+ // Create integration that should run a Xslt transformation whose template needs to be present at build time
+ name := RandomizedSuffixName("xslt")
+ g.Expect(KamelRunWithID(t, operatorID, ns, "files/registry/classpath/Xslt.java", "--name", name,
+ "-d", "file://files/registry/classpath/cheese.xsl?targetPath=xslt/cheese.xsl&classpath=true",
+ ).Execute()).To(Succeed())
+
+ g.Eventually(IntegrationPodPhase(t, ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
+ g.Eventually(IntegrationConditionStatus(t, ns, name, v1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(corev1.ConditionTrue))
+ g.Eventually(IntegrationLogs(t, ns, name), TestTimeoutShort).Should(ContainSubstring("<cheese><item>A</item></cheese>"))
+ })
+
+ // Clean up
+ g.Expect(Kamel(t, "delete", "--all", "-n", ns).Execute()).To(Succeed())
})
-
- t.Run("local files are mounted in the integration container at the default path", func(t *testing.T) {
- name := RandomizedSuffixName("laughing-route-default-path")
-
- g.Expect(KamelRunWithID(t, operatorID, operatorNS, "files/registry/LaughingRoute.java",
- "--name", name,
- "-p", "location=/deployments/?filename=laugh.txt",
- "-d", "file://files/registry/laugh.txt",
- ).Execute()).To(Succeed())
-
- g.Eventually(IntegrationPodPhase(t, operatorNS, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, operatorNS, name, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
- g.Eventually(IntegrationLogs(t, operatorNS, name), TestTimeoutShort).Should(ContainSubstring("haha"))
- })
-
- t.Run("local files are mounted in the integration container at a custom path", func(t *testing.T) {
- name := RandomizedSuffixName("laughing-route-custom-path")
- customPath := "this/is/a/custom/path/"
-
- g.Expect(KamelRunWithID(t, operatorID, operatorNS, "files/registry/LaughingRoute.java",
- "--name", name,
- "-p", fmt.Sprintf("location=%s", customPath),
- "-d", fmt.Sprintf("file://files/registry/laugh.txt?targetPath=%slaugh.txt", customPath),
- ).Execute()).To(Succeed())
-
- g.Eventually(IntegrationPodPhase(t, operatorNS, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, operatorNS, name, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
- g.Eventually(IntegrationLogs(t, operatorNS, name), TestTimeoutShort).Should(ContainSubstring("haha"))
- })
-
- t.Run("local directory is mounted in the integration container", func(t *testing.T) {
- name := RandomizedSuffixName("laughing-route-directory")
-
- g.Expect(KamelRunWithID(t, operatorID, operatorNS, "files/registry/LaughingRoute.java",
- "--name", name,
- "-p", "location=files/registry/",
- "-d", fmt.Sprintf("file://files/registry/laughs/?targetPath=files/registry/"),
- ).Execute()).To(Succeed())
-
- g.Eventually(IntegrationPodPhase(t, operatorNS, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, operatorNS, name, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
- g.Eventually(IntegrationLogs(t, operatorNS, name), TestTimeoutShort).Should(ContainSubstring("haha"))
- g.Eventually(IntegrationLogs(t, operatorNS, name), TestTimeoutShort).Should(ContainSubstring("hehe"))
- })
-
- t.Run("pom file is extracted from JAR", func(t *testing.T) {
- // Create integration that should decrypt foobar and log it
- name := RandomizedSuffixName("foobar-decryption-pom-extraction")
- jar, err := filepath.Abs("files/registry/sample-decryption-1.0.jar")
- require.NoError(t, err)
-
- g.Expect(KamelRunWithID(t, operatorID, operatorNS, "files/registry/FoobarDecryption.java",
- "--name", name,
- "-d", fmt.Sprintf("file://%s", jar),
- ).Execute()).To(Succeed())
-
- g.Eventually(IntegrationPodPhase(t, operatorNS, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, operatorNS, name, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
- g.Eventually(IntegrationLogs(t, operatorNS, name), TestTimeoutShort).Should(ContainSubstring("foobar"))
- })
-
- t.Run("dependency can be used at build time", func(t *testing.T) {
- // Create integration that should run an Xslt transformation whose template needs to be present at build time
- name := RandomizedSuffixName("xslt")
- g.Expect(KamelRunWithID(t, operatorID, operatorNS, "files/registry/classpath/Xslt.java", "--name", name,
- "-d", "file://files/registry/classpath/cheese.xsl?targetPath=xslt/cheese.xsl&classpath=true",
- ).Execute()).To(Succeed())
-
- g.Eventually(IntegrationPodPhase(t, operatorNS, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
- g.Eventually(IntegrationConditionStatus(t, operatorNS, name, v1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(corev1.ConditionTrue))
- g.Eventually(IntegrationLogs(t, operatorNS, name), TestTimeoutShort).Should(ContainSubstring("<cheese><item>A</item></cheese>"))
- })
-
- // Clean up
- g.Expect(Kamel(t, "delete", "--all", "-n", operatorNS).Execute()).To(Succeed())
}
diff --git a/e2e/common/misc/rest_test.go b/e2e/common/misc/rest_test.go
index 9a89ab154..1a4f30492 100644
--- a/e2e/common/misc/rest_test.go
+++ b/e2e/common/misc/rest_test.go
@@ -34,6 +34,7 @@ import (
corev1 "k8s.io/api/core/v1"
. "github.com/apache/camel-k/v2/e2e/support"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
"github.com/apache/camel-k/v2/pkg/util/openshift"
)
@@ -41,6 +42,12 @@ func TestRunRest(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-rest"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
ocp, err := openshift.IsOpenShift(TestClient(t))
require.NoError(t, err)
diff --git a/e2e/common/misc/scale_binding_test.go b/e2e/common/misc/scale_binding_test.go
index 141839953..f9dae8451 100644
--- a/e2e/common/misc/scale_binding_test.go
+++ b/e2e/common/misc/scale_binding_test.go
@@ -43,6 +43,12 @@ func TestPipeScale(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-pipe-scale"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
ocp, err := openshift.IsOpenShift(TestClient(t))
require.NoError(t, err)
diff --git a/e2e/common/misc/scale_integration_test.go b/e2e/common/misc/scale_integration_test.go
index 3ba99050b..bad583991 100644
--- a/e2e/common/misc/scale_integration_test.go
+++ b/e2e/common/misc/scale_integration_test.go
@@ -42,6 +42,12 @@ func TestIntegrationScale(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-integration-scale"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
name := RandomizedSuffixName("java")
g.Expect(KamelRunWithID(t, operatorID, ns, "files/Java.java", "--name", name).Execute()).To(Succeed())
diff --git a/e2e/common/misc/structured_logs_test.go b/e2e/common/misc/structured_logs_test.go
index 9bb03c8c3..5214aaeb9 100644
--- a/e2e/common/misc/structured_logs_test.go
+++ b/e2e/common/misc/structured_logs_test.go
@@ -38,6 +38,12 @@ func TestStructuredLogs(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-structured-logs"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
name := RandomizedSuffixName("java")
g.Expect(KamelRunWithID(t, operatorID, ns, "files/Java.java",
@@ -46,7 +52,7 @@ func TestStructuredLogs(t *testing.T) {
g.Eventually(IntegrationPodPhase(t, ns, name), TestTimeoutLong).Should(Equal(corev1.PodRunning))
g.Eventually(IntegrationConditionStatus(t, ns, name, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue))
- pod := OperatorPod(t, operatorNS)()
+ pod := OperatorPod(t, ns)()
g.Expect(pod).NotTo(BeNil())
// pod.Namespace could be different from ns if using global operator
diff --git a/e2e/common/runtimes/default.go b/e2e/common/runtimes/default.go
deleted file mode 100644
index 7191aee4f..000000000
--- a/e2e/common/runtimes/default.go
+++ /dev/null
@@ -1,28 +0,0 @@
-//go:build integration
-// +build integration
-
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package runtimes
-
-import (
- "github.com/apache/camel-k/v2/e2e/support"
- "github.com/apache/camel-k/v2/pkg/platform"
-)
-
-var operatorID = support.GetEnvOrDefault("CAMEL_K_OPERATOR_ID", platform.DefaultPlatformName)
diff --git a/e2e/common/runtimes/runtimes_test.go b/e2e/common/runtimes/runtimes_test.go
index af9b9bd22..81ed54642 100644
--- a/e2e/common/runtimes/runtimes_test.go
+++ b/e2e/common/runtimes/runtimes_test.go
@@ -37,6 +37,13 @@ func TestSourceLessIntegrations(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-runtimes"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
+
var cmData = make(map[string]string)
cmData["my-file.txt"] = "Hello World!"
CreatePlainTextConfigmap(t, ns, "my-cm-sourceless", cmData)
diff --git a/e2e/common/traits/affinity_test.go b/e2e/common/traits/affinity_test.go
index c61cf6cb3..73a75b94d 100644
--- a/e2e/common/traits/affinity_test.go
+++ b/e2e/common/traits/affinity_test.go
@@ -40,6 +40,12 @@ func TestAffinityTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-affinity"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
var hostname string
if node, err := selectSchedulableNode(t); err == nil {
diff --git a/e2e/common/traits/builder_test.go b/e2e/common/traits/builder_test.go
index e9be79107..6f8d8f860 100644
--- a/e2e/common/traits/builder_test.go
+++ b/e2e/common/traits/builder_test.go
@@ -37,8 +37,15 @@ import (
)
func TestBuilderTrait(t *testing.T) {
- // Test not able to run in parallel because of maven profile tests
+ t.Parallel()
+
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-builder"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("Run build strategy routine", func(t *testing.T) {
name := RandomizedSuffixName("java")
@@ -237,9 +244,9 @@ func TestBuilderTrait(t *testing.T) {
t.Run("Run maven profile", func(t *testing.T) {
name := RandomizedSuffixName("java-maven-profile")
- mavenProfile1Cm := newMavenProfileConfigMap(operatorNS, "maven-profile-owasp", "owasp-profile")
+ mavenProfile1Cm := newMavenProfileConfigMap(ns, "maven-profile-owasp", "owasp-profile")
g.Expect(TestClient(t).Create(TestContext, mavenProfile1Cm)).To(Succeed())
- mavenProfile2Cm := newMavenProfileConfigMap(operatorNS, "maven-profile-dependency", "dependency-profile")
+ mavenProfile2Cm := newMavenProfileConfigMap(ns, "maven-profile-dependency", "dependency-profile")
g.Expect(TestClient(t).Create(TestContext, mavenProfile2Cm)).To(Succeed())
g.Expect(KamelRunWithID(t, operatorID, ns, "files/Java.java",
diff --git a/e2e/common/traits/camel_test.go b/e2e/common/traits/camel_test.go
index eecb232bc..f9f6b4ab3 100644
--- a/e2e/common/traits/camel_test.go
+++ b/e2e/common/traits/camel_test.go
@@ -37,6 +37,12 @@ func TestCamelTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-camel"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("properties changes should not rebuild", func(t *testing.T) {
diff --git a/e2e/common/traits/container_test.go b/e2e/common/traits/container_test.go
index 3669b90b1..a5fd859d3 100644
--- a/e2e/common/traits/container_test.go
+++ b/e2e/common/traits/container_test.go
@@ -38,6 +38,12 @@ func TestContainerTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-container"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("Container image pull policy and resources configuration", func(t *testing.T) {
name := RandomizedSuffixName("java1")
diff --git a/e2e/common/traits/default.go b/e2e/common/traits/default.go
deleted file mode 100644
index 4721ebd36..000000000
--- a/e2e/common/traits/default.go
+++ /dev/null
@@ -1,29 +0,0 @@
-//go:build integration
-// +build integration
-
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package traits
-
-import (
- "github.com/apache/camel-k/v2/e2e/support"
- "github.com/apache/camel-k/v2/pkg/platform"
-)
-
-var operatorNS = support.TestDefaultNamespace + "-traits"
-var operatorID = platform.DefaultPlatformName + "-traits"
diff --git a/e2e/common/traits/deployment_test.go b/e2e/common/traits/deployment_test.go
index 1ed16e07b..67fcf4bd5 100644
--- a/e2e/common/traits/deployment_test.go
+++ b/e2e/common/traits/deployment_test.go
@@ -41,6 +41,12 @@ func TestRecreateDeploymentStrategyTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-deployment"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("Run with Recreate Deployment Strategy", func(t *testing.T) {
name := RandomizedSuffixName("java")
@@ -72,7 +78,6 @@ func TestRecreateDeploymentStrategyTrait(t *testing.T) {
g.Expect(deploymentTrait).ToNot(BeNil())
g.Expect(len(deploymentTrait)).To(Equal(1))
g.Expect(deploymentTrait["strategy"]).To(Equal(string(appsv1.RecreateDeploymentStrategyType)))
-
})
g.Expect(Kamel(t, "delete", "--all", "-n", ns).Execute()).To(Succeed())
@@ -83,6 +88,12 @@ func TestRollingUpdateDeploymentStrategyTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-deployment-rolling"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("Run with RollingUpdate Deployment Strategy", func(t *testing.T) {
g.Expect(KamelRunWithID(t, operatorID, ns, "files/Java.java",
diff --git a/e2e/common/traits/error_handler_test.go b/e2e/common/traits/error_handler_test.go
index 59d3bf530..73a102375 100644
--- a/e2e/common/traits/error_handler_test.go
+++ b/e2e/common/traits/error_handler_test.go
@@ -37,6 +37,12 @@ func TestErrorHandlerTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-errorhandler"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("Run errored integration with error handler", func(t *testing.T) {
name := RandomizedSuffixName("error-handler")
diff --git a/e2e/common/traits/errored_trait_test.go b/e2e/common/traits/errored_trait_test.go
index 4f127df88..6b807221d 100644
--- a/e2e/common/traits/errored_trait_test.go
+++ b/e2e/common/traits/errored_trait_test.go
@@ -37,6 +37,12 @@ func TestErroredTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-error"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("Integration trait should fail", func(t *testing.T) {
name := RandomizedSuffixName("it-errored")
diff --git a/e2e/common/traits/health_test.go b/e2e/common/traits/health_test.go
index 87bca537f..13914cc6e 100644
--- a/e2e/common/traits/health_test.go
+++ b/e2e/common/traits/health_test.go
@@ -46,6 +46,12 @@ func TestHealthTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-health"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("Readiness condition with stopped route scaled", func(t *testing.T) {
name := RandomizedSuffixName("java")
diff --git a/e2e/common/traits/istio_test.go b/e2e/common/traits/istio_test.go
index 95c3323c8..0fd149802 100644
--- a/e2e/common/traits/istio_test.go
+++ b/e2e/common/traits/istio_test.go
@@ -23,7 +23,6 @@ limitations under the License.
package traits
import (
- "fmt"
"testing"
. "github.com/onsi/gomega"
@@ -39,7 +38,7 @@ func TestIstioTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
- operatorID := fmt.Sprintf("camel-k-%s", ns)
+ operatorID := "camel-k-traits-istio"
g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
diff --git a/e2e/common/traits/jolokia_test.go b/e2e/common/traits/jolokia_test.go
index 97dd558a7..419b9f880 100644
--- a/e2e/common/traits/jolokia_test.go
+++ b/e2e/common/traits/jolokia_test.go
@@ -39,6 +39,12 @@ func TestJolokiaTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-jolokia"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("Run Java with Jolokia", func(t *testing.T) {
name := RandomizedSuffixName("java")
diff --git a/e2e/common/traits/jvm_test.go b/e2e/common/traits/jvm_test.go
index 87fc90cdd..5f220a587 100644
--- a/e2e/common/traits/jvm_test.go
+++ b/e2e/common/traits/jvm_test.go
@@ -40,6 +40,12 @@ func TestJVMTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-jvm"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
// Store a configmap holding a jar
var cmData = make(map[string][]byte)
diff --git a/e2e/common/traits/kamelet_test.go b/e2e/common/traits/kamelet_test.go
index b79870091..2d2516f2d 100644
--- a/e2e/common/traits/kamelet_test.go
+++ b/e2e/common/traits/kamelet_test.go
@@ -37,6 +37,12 @@ func TestKameletTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-kamelet"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("discover kamelet capabilities", func(t *testing.T) {
template := map[string]interface{}{
diff --git a/e2e/common/traits/main_test.go b/e2e/common/traits/main_test.go
deleted file mode 100644
index f7f835f6a..000000000
--- a/e2e/common/traits/main_test.go
+++ /dev/null
@@ -1,62 +0,0 @@
-//go:build integration
-// +build integration
-
-// To enable compilation of this file in Goland, go to "Settings -> Go -> Vendoring & Build Tags -> Custom Tags" and add "integration"
-
-/*
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package traits
-
-import (
- "fmt"
- v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
- "os"
- "testing"
-
- . "github.com/onsi/gomega"
-
- . "github.com/apache/camel-k/v2/e2e/support"
-)
-
-func TestMain(m *testing.M) {
- justCompile := GetEnvOrDefault("CAMEL_K_E2E_JUST_COMPILE", "false")
- if justCompile == "true" {
- os.Exit(m.Run())
- }
-
- g := NewGomega(func(message string, callerSkip ...int) {
- fmt.Printf("Test setup failed! - %s\n", message)
- })
-
- var t *testing.T
-
- g.Expect(TestClient(t)).ShouldNot(BeNil())
-
- // Install global operator for tests in this package, all tests must use this operatorID so tests can run in parallel and gain execution speed
- g.Expect(NewNamedTestNamespace(t, operatorNS, false)).ShouldNot(BeNil())
- g.Expect(CopyCamelCatalog(t, operatorNS, operatorID)).To(Succeed())
- g.Expect(KamelInstallWithID(t, operatorID, operatorNS, "--global", "--force").Execute()).To(Succeed())
- g.Eventually(SelectedPlatformPhase(t, operatorNS, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
-
- exitCode := m.Run()
-
- g.Expect(UninstallFromNamespace(t, operatorNS))
- g.Expect(DeleteNamespace(t, operatorNS)).To(Succeed())
-
- os.Exit(exitCode)
-}
diff --git a/e2e/common/traits/master_test.go b/e2e/common/traits/master_test.go
index ce52fb46c..65713e2bd 100644
--- a/e2e/common/traits/master_test.go
+++ b/e2e/common/traits/master_test.go
@@ -32,12 +32,19 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
. "github.com/apache/camel-k/v2/e2e/support"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
)
func TestMasterTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-master"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("master works", func(t *testing.T) {
g.Expect(KamelRunWithID(t, operatorID, ns, "files/Master.java").Execute()).To(Succeed())
diff --git a/e2e/common/traits/openapi_test.go b/e2e/common/traits/openapi_test.go
index afd60051a..2ac84e4d2 100644
--- a/e2e/common/traits/openapi_test.go
+++ b/e2e/common/traits/openapi_test.go
@@ -32,12 +32,19 @@ import (
corev1 "k8s.io/api/core/v1"
. "github.com/apache/camel-k/v2/e2e/support"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
)
func TestOpenAPI(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-openapi"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
openapiContent, err := ioutil.ReadFile("./files/openapi/petstore-api.yaml")
require.NoError(t, err)
diff --git a/e2e/common/traits/pdb_test.go b/e2e/common/traits/pdb_test.go
index a3cb8e803..b6b355121 100644
--- a/e2e/common/traits/pdb_test.go
+++ b/e2e/common/traits/pdb_test.go
@@ -46,6 +46,12 @@ func TestPodDisruptionBudgetTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-pdb"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
name := RandomizedSuffixName("java")
g.Expect(KamelRunWithID(t, operatorID, ns, "files/Java.java",
diff --git a/e2e/common/traits/pod_test.go b/e2e/common/traits/pod_test.go
index 66360f55f..28b05cae8 100644
--- a/e2e/common/traits/pod_test.go
+++ b/e2e/common/traits/pod_test.go
@@ -37,6 +37,12 @@ func TestPodTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-pod"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
tc := []struct {
name string
diff --git a/e2e/common/traits/prometheus_test.go b/e2e/common/traits/prometheus_test.go
index b2ad103f5..6d11d9df2 100644
--- a/e2e/common/traits/prometheus_test.go
+++ b/e2e/common/traits/prometheus_test.go
@@ -44,8 +44,15 @@ import (
)
func TestPrometheusTrait(t *testing.T) {
- // test not able to run in parallel
+ t.Parallel()
+
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-prometheus"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
ocp, err := openshift.IsOpenShift(TestClient(t))
require.NoError(t, err)
diff --git a/e2e/common/traits/pull_secret_test.go b/e2e/common/traits/pull_secret_test.go
index d8ec4fb20..1267e9fa6 100644
--- a/e2e/common/traits/pull_secret_test.go
+++ b/e2e/common/traits/pull_secret_test.go
@@ -39,6 +39,12 @@ func TestPullSecretTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-pull-secret"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
ocp, err := openshift.IsOpenShift(TestClient(t))
g.Expect(err).To(BeNil())
diff --git a/e2e/common/traits/route_test.go b/e2e/common/traits/route_test.go
index 52807a0b8..b8b031c4b 100644
--- a/e2e/common/traits/route_test.go
+++ b/e2e/common/traits/route_test.go
@@ -43,6 +43,7 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
. "github.com/apache/camel-k/v2/e2e/support"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
"github.com/apache/camel-k/v2/pkg/util"
"github.com/apache/camel-k/v2/pkg/util/openshift"
)
@@ -74,6 +75,12 @@ func TestRunRoutes(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-route"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns, "--trait-profile=openshift").Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
ocp, err := openshift.IsOpenShift(TestClient(t))
if !ocp {
@@ -82,9 +89,6 @@ func TestRunRoutes(t *testing.T) {
}
require.NoError(t, err)
- operatorID := "camel-k-trait-route"
- g.Expect(KamelInstallWithID(t, operatorID, ns, "--trait-profile=openshift").Execute()).To(Succeed())
-
// create a test secret of type tls with certificates
// this secret is used to setupt the route TLS object across diferent tests
secret, err := createSecret(t, ns)
diff --git a/e2e/common/traits/service_binding_test.go b/e2e/common/traits/service_binding_test.go
index a6b66ef87..6f07f0f12 100644
--- a/e2e/common/traits/service_binding_test.go
+++ b/e2e/common/traits/service_binding_test.go
@@ -39,6 +39,12 @@ func TestServiceBindingTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-service-binding"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("Integration Service Binding", func(t *testing.T) {
// Create our mock service config
diff --git a/e2e/common/traits/service_test.go b/e2e/common/traits/service_test.go
index 02f486610..def097354 100644
--- a/e2e/common/traits/service_test.go
+++ b/e2e/common/traits/service_test.go
@@ -31,12 +31,19 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
. "github.com/apache/camel-k/v2/e2e/support"
+ v1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1"
)
func TestServiceTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-service"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("NodePort service", func(t *testing.T) {
g.Expect(KamelRunWithID(t, operatorID, ns, "files/PlatformHttpServer.java",
diff --git a/e2e/common/traits/toleration_test.go b/e2e/common/traits/toleration_test.go
index 2bd3050a8..64491bdb1 100644
--- a/e2e/common/traits/toleration_test.go
+++ b/e2e/common/traits/toleration_test.go
@@ -39,6 +39,12 @@ func TestTolerationTrait(t *testing.T) {
t.Parallel()
WithNewTestNamespace(t, func(g *WithT, ns string) {
+ operatorID := "camel-k-traits-toleration"
+ g.Expect(CopyCamelCatalog(t, ns, operatorID)).To(Succeed())
+ g.Expect(CopyIntegrationKits(t, ns, operatorID)).To(Succeed())
+ g.Expect(KamelInstallWithID(t, operatorID, ns).Execute()).To(Succeed())
+
+ g.Eventually(SelectedPlatformPhase(t, ns, operatorID), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady))
t.Run("Run Java with node toleration operation exists", func(t *testing.T) {
name := RandomizedSuffixName("java1")
diff --git a/script/Makefile b/script/Makefile
index 79f5beccc..f518b09e4 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -258,6 +258,7 @@ test-common: do-build
#
test-smoke: do-build
FAILED=0; STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)"; \
+ go test -timeout 30m -v ./e2e/common/main_test.go -tags=integration $(TEST_INTEGRATION_COMMON_LANG_RUN) $(GOTESTFMT) || FAILED=1; \
go test -timeout 30m -v ./e2e/common/languages -tags=integration -parallel=$(TEST_COMMON_PARALLEL_COUNT) $(TEST_INTEGRATION_COMMON_LANG_RUN) $(GOTESTFMT) || FAILED=1; \
go test -timeout 30m -v \
./e2e/common/misc/default.go \