squakez commented on code in PR #6920:
URL: https://github.com/apache/camel-k/pull/6920#discussion_r4389943448


##########
e2e/keda/keda_kafka_test.go:
##########
@@ -0,0 +1,167 @@
+//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 keda
+
+import (
+       "context"
+       "testing"
+
+       . "github.com/onsi/gomega"
+       "github.com/onsi/gomega/gstruct"
+       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 TestKafkaKedaAutoscale(t *testing.T) {
+       WithExistingNamedTestNamespace(t, func(ctx context.Context, g *WithT, 
ns string) {
+               t.Run("Serverless Kafka Autoscale", func(t *testing.T) {
+                       consumerName := "keda-kafka-auto-discovery"
+                       producerName := "timer-to-kafka"
+
+                       // Ensure cleanup on failure
+                       defer func() {

Review Comment:
   No need for it. Each test is already in charge to clean resources created 
there.



##########
e2e/keda/setup/setup.sh:
##########
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+#### 1. Setup KEDA Operator
+# Installs KEDA operator into 'keda' namespace
+kubectl apply --server-side -f 
https://github.com/kedacore/keda/releases/download/v2.17.2/keda-2.17.2.yaml
+kubectl rollout status deployment keda-operator -n keda --timeout=180s
+
+#### 2. Setup Plain Ephemeral Kafka (No Operator required)
+kubectl apply -f $SCRIPT_DIR/kafka-ephemeral.yaml -n keda

Review Comment:
   We better control this at single test level. Just apply and wait a readiness 
condition which can be specific for each third party service.



##########
e2e/keda/files/keda-kafka-auto-discovery-with-manual.yaml:
##########
@@ -0,0 +1,23 @@
+apiVersion: camel.apache.org/v1
+kind: Integration
+metadata:
+  name: keda-kafka-auto-discovery-with-manual
+  namespace: keda
+spec:
+  sources:
+    - content: |
+        
from("kafka:my-topic?brokers=my-cluster-kafka-bootstrap.keda.svc:9092&groupId=manual-group")
+          .log("${body}");
+      name: routes.java
+  traits:
+    keda:
+      enabled: true
+      minReplicaCount: 0
+      maxReplicaCount: 2
+      triggers:

Review Comment:
   Keep a copy of the comments in the original source as it can be useful for 
future maintenance



##########
e2e/keda/setup/kafka-ephemeral.yaml:
##########
@@ -0,0 +1,88 @@
+# ---------------------------------------------------------------------------

Review Comment:
   This one should be in files and not in setup folder.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to