This is an automated email from the ASF dual-hosted git repository. pcongiusti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit f35941d7c2ae1d45774ede1ccc5e8e3214e9eb55 Author: Pasquale Congiusti <[email protected]> AuthorDate: Wed Jun 26 12:26:10 2024 +0200 chore(e2e): must use global operator --- e2e/knative/default.go | 28 --------------------- e2e/knative/gc_test.go | 8 +++--- e2e/knative/kamelet_test.go | 8 +++--- e2e/knative/knative_pipes_test.go | 44 ++++++++++++++------------------ e2e/knative/knative_platform_test.go | 49 +----------------------------------- e2e/knative/openapi_test.go | 5 +--- e2e/knative/pod_test.go | 6 ++--- e2e/telemetry/telemetry_test.go | 8 ++---- 8 files changed, 32 insertions(+), 124 deletions(-) diff --git a/e2e/knative/default.go b/e2e/knative/default.go deleted file mode 100644 index 4cf9e2d91..000000000 --- a/e2e/knative/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 knative - -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/knative/gc_test.go b/e2e/knative/gc_test.go index f5e7e64fa..0430d639b 100644 --- a/e2e/knative/gc_test.go +++ b/e2e/knative/gc_test.go @@ -36,7 +36,7 @@ import ( func TestGarbageCollectResources(t *testing.T) { WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) { integration := "platform-http-server" - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/PlatformHttpServer.java", "-t", "knative-service.enabled=false").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/PlatformHttpServer.java", "-t", "knative-service.enabled=false").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, integration), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, integration, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) @@ -44,7 +44,7 @@ func TestGarbageCollectResources(t *testing.T) { g.Eventually(ServiceType(t, ctx, ns, integration), TestTimeoutMedium).Should(Equal(corev1.ServiceTypeClusterIP)) // Update integration and enable knative service trait - existing arbitrary service should be garbage collected - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/PlatformHttpServer.java").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/PlatformHttpServer.java").Execute()).To(Succeed()) g.Eventually(KnativeService(t, ctx, ns, integration), TestTimeoutShort).ShouldNot(BeNil()) g.Eventually(ServiceType(t, ctx, ns, integration), TestTimeoutShort).Should(Equal(corev1.ServiceTypeExternalName)) @@ -53,14 +53,12 @@ func TestGarbageCollectResources(t *testing.T) { g.Eventually(IntegrationConditionStatus(t, ctx, ns, integration, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) // Disable knative service trait again - this time knative service should be garbage collected - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/PlatformHttpServer.java", "-t", "knative-service.enabled=false").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/PlatformHttpServer.java", "-t", "knative-service.enabled=false").Execute()).To(Succeed()) g.Eventually(KnativeService(t, ctx, ns, integration), TestTimeoutMedium).Should(BeNil()) g.Eventually(ServiceType(t, ctx, ns, integration), TestTimeoutMedium).Should(Equal(corev1.ServiceTypeClusterIP)) g.Eventually(IntegrationPodPhase(t, ctx, ns, integration), TestTimeoutMedium).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, integration, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) - - g.Expect(Kamel(t, ctx, "delete", "--all", "-n", ns).Execute()).To(Succeed()) }) } diff --git a/e2e/knative/kamelet_test.go b/e2e/knative/kamelet_test.go index 341a885a5..b9dea9832 100644 --- a/e2e/knative/kamelet_test.go +++ b/e2e/knative/kamelet_test.go @@ -45,14 +45,14 @@ func TestKameletChange(t *testing.T) { knChannel := "test-kamelet-messages" knChannelConf := fmt.Sprintf("%s:InMemoryChannel:%s", messaging.SchemeGroupVersion.String(), knChannel) timerSource := "my-timer-source" - g.Expect(CreateTimerKameletWithID(t, ctx, operatorID, ns, timerSource)()).To(Succeed()) + g.Expect(CreateTimerKamelet(t, ctx, ns, timerSource)()).To(Succeed()) g.Expect(CreateKnativeChannel(t, ctx, ns, knChannel)()).To(Succeed()) // Consumer route that will read from the Knative channel - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/test-kamelet-display.yaml", "-w").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/test-kamelet-display.yaml", "-w").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "test-kamelet-display")).Should(Equal(corev1.PodRunning)) // Create the Pipe - g.Expect(KamelBindWithID(t, ctx, operatorID, ns, timerSource, knChannelConf, "-p", "source.message=HelloKnative!", + g.Expect(KamelBind(t, ctx, ns, timerSource, knChannelConf, "-p", "source.message=HelloKnative!", "--trait", "health.enabled=true", "--trait", "health.readiness-initial-delay=10", "--name", timerPipe).Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, timerPipe)).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, timerPipe, v1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(corev1.ConditionTrue)) @@ -66,7 +66,7 @@ func TestKameletChange(t *testing.T) { )) // Update the Pipe - g.Expect(KamelBindWithID(t, ctx, operatorID, ns, timerSource, knChannelConf, "-p", "source.message=message is Hi", + g.Expect(KamelBind(t, ctx, ns, timerSource, knChannelConf, "-p", "source.message=message is Hi", "--trait", "health.enabled=true", "--trait", "health.readiness-initial-delay=10", "--name", timerPipe).Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, timerPipe), TestTimeoutLong).Should(Equal(corev1.PodRunning)) diff --git a/e2e/knative/knative_pipes_test.go b/e2e/knative/knative_pipes_test.go index eb5a63fd2..88d8f3135 100644 --- a/e2e/knative/knative_pipes_test.go +++ b/e2e/knative/knative_pipes_test.go @@ -24,12 +24,12 @@ package knative import ( "context" - "fmt" - . "github.com/onsi/gomega" - v1 "k8s.io/api/core/v1" "testing" "time" + . "github.com/onsi/gomega" + v1 "k8s.io/api/core/v1" + . "github.com/apache/camel-k/v2/e2e/support" camelv1 "github.com/apache/camel-k/v2/pkg/apis/camel/v1" ) @@ -42,13 +42,13 @@ func TestKnativePipes(t *testing.T) { g.Expect(CreateKnativeChannel(t, ctx, ns, knChannelWords)()).To(Succeed()) t.Run("Service combo", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knative2.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/knative2.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knative2"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "knative2", camelv1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(v1.ConditionTrue)) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knative3.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/knative3.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knative3"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "knative3", camelv1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(v1.ConditionTrue)) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knative1.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/knative1.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knative1"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "knative1", camelv1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(v1.ConditionTrue)) // Correct logs @@ -62,8 +62,8 @@ func TestKnativePipes(t *testing.T) { }) t.Run("Channel combo v1beta1", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativech2.yaml").Execute()).To(Succeed()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativech1.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/knativech2.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/knativech1.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativech2"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativech1"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationLogs(t, ctx, ns, "knativech2"), TestTimeoutMedium).Should(ContainSubstring("Received: Hello from knativech1")) @@ -71,8 +71,8 @@ func TestKnativePipes(t *testing.T) { }) t.Run("Channel combo get to post", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativegetpost2.yaml").Execute()).To(Succeed()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativegetpost1.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/knativegetpost2.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/knativegetpost1.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativegetpost2"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativegetpost1"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationLogs(t, ctx, ns, "knativegetpost2"), TestTimeoutMedium).Should(ContainSubstring("Received: []")) @@ -80,9 +80,9 @@ func TestKnativePipes(t *testing.T) { }) t.Run("Multi channel chain", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativemultihop3.yaml").Execute()).To(Succeed()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativemultihop2.yaml").Execute()).To(Succeed()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativemultihop1.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/knativemultihop3.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/knativemultihop2.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/knativemultihop1.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativemultihop3"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativemultihop2"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativemultihop1"), TestTimeoutLong).Should(Equal(v1.PodRunning)) @@ -96,7 +96,7 @@ func TestKnativePipes(t *testing.T) { }) t.Run("Flow", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/flow.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/flow.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "flow"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "flow", camelv1.IntegrationConditionReady), TestTimeoutLong).Should(Equal(v1.ConditionTrue)) @@ -108,7 +108,7 @@ func TestKnativePipes(t *testing.T) { }) t.Run("Knative-service disabled", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/http_out.yaml", "-t", "knative-service.enabled=false").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/http_out.yaml", "-t", "knative-service.enabled=false").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "http-out"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(Service(t, ctx, ns, "http-out"), TestTimeoutShort).ShouldNot(BeNil()) g.Consistently(KnativeService(t, ctx, ns, "http-out"), TestTimeoutShort).Should(BeNil()) @@ -116,14 +116,14 @@ func TestKnativePipes(t *testing.T) { }) t.Run("Knative-service priority", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/http_out.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/http_out.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "http-out"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(KnativeService(t, ctx, ns, "http-out"), TestTimeoutShort).ShouldNot(BeNil()) g.Expect(Kamel(t, ctx, "delete", "--all", "-n", ns).Execute()).To(Succeed()) }) t.Run("Knative-service annotation", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knative2.yaml", "-t", "knative-service.annotations.'haproxy.router.openshift.io/balance'=roundrobin").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/knative2.yaml", "-t", "knative-service.annotations.'haproxy.router.openshift.io/balance'=roundrobin").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knative2"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(KnativeService(t, ctx, ns, "knative2"), TestTimeoutShort).ShouldNot(BeNil()) ks := KnativeService(t, ctx, ns, "knative2")() @@ -136,18 +136,12 @@ func TestKnativePipes(t *testing.T) { func TestRunBroker(t *testing.T) { WithNewTestNamespaceWithKnativeBroker(t, func(ctx context.Context, g *WithT, ns string) { - operatorID := fmt.Sprintf("camel-k-%s", ns) - g.Expect(KamelInstallWithID(t, ctx, operatorID, ns, "--trait-profile", "knative")).To(Succeed()) - - g.Eventually(SelectedPlatformPhase(t, ctx, ns, operatorID), TestTimeoutMedium).Should(Equal(camelv1.IntegrationPlatformPhaseReady)) - - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativeevt1.yaml").Execute()).To(Succeed()) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/knativeevt2.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/knativeevt1.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/knativeevt2.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativeevt1"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationPodPhase(t, ctx, ns, "knativeevt2"), TestTimeoutLong).Should(Equal(v1.PodRunning)) g.Eventually(IntegrationLogs(t, ctx, ns, "knativeevt2"), TestTimeoutMedium).Should(ContainSubstring("Received 1: Hello 1")) g.Eventually(IntegrationLogs(t, ctx, ns, "knativeevt2"), TestTimeoutMedium).Should(ContainSubstring("Received 2: Hello 2")) g.Eventually(IntegrationLogs(t, ctx, ns, "knativeevt2")).ShouldNot(ContainSubstring("Received 1: Hello 2")) - g.Expect(Kamel(t, ctx, "delete", "--all", "-n", ns).Execute()).To(Succeed()) }) } diff --git a/e2e/knative/knative_platform_test.go b/e2e/knative/knative_platform_test.go index a6223495e..7fdbb1c4f 100644 --- a/e2e/knative/knative_platform_test.go +++ b/e2e/knative/knative_platform_test.go @@ -24,69 +24,22 @@ package knative import ( "context" - "strings" "testing" . "github.com/onsi/gomega" - "github.com/stretchr/testify/require" 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/dsl" - "github.com/apache/camel-k/v2/pkg/util/knative" ) func TestKnativePlatformDetection(t *testing.T) { - g := NewWithT(t) - - installed, err := knative.IsServingInstalled(TestClient(t)) - g.Expect(err).NotTo(HaveOccurred()) - if !installed { - t.Error("Knative not installed in the cluster") - t.FailNow() - } - WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) { - operatorID := "camel-k-knative" - // Install without profile (should automatically detect the presence of Knative) - g.Expect(KamelInstallWithID(t, ctx, operatorID, ns)).To(Succeed()) - g.Eventually(PlatformPhase(t, ctx, ns), TestTimeoutMedium).Should(Equal(v1.IntegrationPlatformPhaseReady)) - g.Eventually(PlatformProfile(t, ctx, ns), TestTimeoutShort).Should(Equal(v1.TraitProfile(""))) - cluster := Platform(t, ctx, ns)().Status.Cluster - - t.Run("run yaml on cluster profile", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/yaml.yaml", "--profile", string(cluster)).Execute()).To(Succeed()) - g.Eventually(IntegrationPodPhase(t, ctx, ns, "yaml"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) - g.Eventually(IntegrationLogs(t, ctx, ns, "yaml"), TestTimeoutShort).Should(ContainSubstring("Magicstring!")) - g.Eventually(IntegrationTraitProfile(t, ctx, ns, "yaml"), TestTimeoutShort).Should(Equal(v1.TraitProfile(string(cluster)))) - // Change something in the integration to produce a redeployment - g.Expect(UpdateIntegration(t, ctx, ns, "yaml", func(it *v1.Integration) { - it.Spec.Profile = "" - content, err := dsl.ToYamlDSL(it.Spec.Flows) - require.NoError(t, err) - newData := strings.ReplaceAll(string(content), "string!", "string!!!") - newFlows, err := dsl.FromYamlDSLString(newData) - require.NoError(t, err) - it.Spec.Flows = newFlows - })).To(Succeed()) - // Spec profile should be reset by "kamel run" - g.Eventually(IntegrationSpecProfile(t, ctx, ns, "yaml")).Should(Equal(v1.TraitProfile(""))) - // When integration is running again ... - g.Eventually(IntegrationPhase(t, ctx, ns, "yaml")).Should(Equal(v1.IntegrationPhaseRunning)) - g.Eventually(IntegrationLogs(t, ctx, ns, "yaml"), TestTimeoutShort).Should(ContainSubstring("Magicstring!!!")) - // It should keep the old profile saved in status - g.Eventually(IntegrationTraitProfile(t, ctx, ns, "yaml"), TestTimeoutMedium).Should(Equal(v1.TraitProfile(cluster))) - - g.Expect(Kamel(t, ctx, "delete", "--all", "-n", ns).Execute()).To(Succeed()) - }) - t.Run("run yaml on automatic profile", func(t *testing.T) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/yaml.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/yaml.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "yaml"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationTraitProfile(t, ctx, ns, "yaml"), TestTimeoutShort).Should(Equal(v1.TraitProfileKnative)) - g.Expect(Kamel(t, ctx, "delete", "--all", "-n", ns).Execute()).To(Succeed()) }) }) } diff --git a/e2e/knative/openapi_test.go b/e2e/knative/openapi_test.go index 0677c5e53..30adb9d4e 100644 --- a/e2e/knative/openapi_test.go +++ b/e2e/knative/openapi_test.go @@ -45,18 +45,15 @@ func TestOpenAPIService(t *testing.T) { cmDataProps["petstore-api.yaml"] = string(openapiContent) CreatePlainTextConfigmap(t, ctx, ns, "my-openapi-knative", cmDataProps) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "--name", "petstore", "--open-api", "configmap:my-openapi-knative", "files/petstore.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "--name", "petstore", "--open-api", "configmap:my-openapi-knative", "files/petstore.yaml").Execute()).To(Succeed()) g.Eventually(KnativeService(t, ctx, ns, "petstore"), TestTimeoutLong). Should(Not(BeNil())) - g.Eventually(IntegrationLogs(t, ctx, ns, "petstore"), TestTimeoutMedium). Should(ContainSubstring("Started listPets (rest://get:/v1:/pets)")) g.Eventually(IntegrationLogs(t, ctx, ns, "petstore"), TestTimeoutMedium). Should(ContainSubstring("Started createPets (rest://post:/v1:/pets)")) g.Eventually(IntegrationLogs(t, ctx, ns, "petstore"), TestTimeoutMedium). Should(ContainSubstring("Started showPetById (rest://get:/v1:/pets/%7BpetId%7D)")) - - g.Expect(Kamel(t, ctx, "delete", "--all", "-n", ns).Execute()).To(Succeed()) }) } diff --git a/e2e/knative/pod_test.go b/e2e/knative/pod_test.go index 7ebdaa04a..d01434bef 100644 --- a/e2e/knative/pod_test.go +++ b/e2e/knative/pod_test.go @@ -36,14 +36,12 @@ import ( func TestPodTraitWithKnative(t *testing.T) { WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) { - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/podtest-knative2.yaml", "--pod-template", "files/template-knative.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/podtest-knative2.yaml", "--pod-template", "files/template-knative.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "podtest-knative2"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "podtest-knative2", v1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(corev1.ConditionTrue)) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/podtest-knative1.yaml").Execute()).To(Succeed()) + g.Expect(KamelRun(t, ctx, ns, "files/podtest-knative1.yaml").Execute()).To(Succeed()) g.Eventually(IntegrationPodPhase(t, ctx, ns, "podtest-knative1"), TestTimeoutLong).Should(Equal(corev1.PodRunning)) g.Eventually(IntegrationConditionStatus(t, ctx, ns, "podtest-knative1", v1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(corev1.ConditionTrue)) g.Eventually(IntegrationLogs(t, ctx, ns, "podtest-knative1"), TestTimeoutShort).Should(ContainSubstring("hello from the template")) - - g.Expect(Kamel(t, ctx, "delete", "--all", "-n", ns).Execute()).To(Succeed()) }) } diff --git a/e2e/telemetry/telemetry_test.go b/e2e/telemetry/telemetry_test.go index e12216126..9520fc286 100644 --- a/e2e/telemetry/telemetry_test.go +++ b/e2e/telemetry/telemetry_test.go @@ -36,15 +36,11 @@ import ( func TestTelemetryTrait(t *testing.T) { WithNewTestNamespace(t, func(ctx context.Context, g *WithT, ns string) { - operatorID := "camel-k-trait-telemetry" - g.Expect(KamelInstallWithID(t, ctx, operatorID, ns)).To(Succeed()) - // Check service is available g.Eventually(ServicesByType(t, ctx, "otlp", corev1.ServiceTypeClusterIP), TestTimeoutLong).ShouldNot(BeEmpty()) // Create integration and activate traces by telemetry trait - - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, + g.Expect(KamelRun(t, ctx, ns, "files/rest-consumer.yaml", "--name", "rest-consumer", "-t", "telemetry.enabled=true", "-t", "telemetry.endpoint=http://opentelemetrycollector.otlp:4317").Execute()).To(Succeed()) @@ -52,7 +48,7 @@ func TestTelemetryTrait(t *testing.T) { name := "Bob" serviceName := fmt.Sprintf("rest-consumer.%s", ns) - g.Expect(KamelRunWithID(t, ctx, operatorID, ns, "files/rest-producer.yaml", + g.Expect(KamelRun(t, ctx, ns, "files/rest-producer.yaml", "-p", fmt.Sprintf("serviceName=%s", serviceName), "-p", "name="+name, "--name", "rest-producer").Execute()).To(Succeed())
