This is an automated email from the ASF dual-hosted git repository.

pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/main by this push:
     new d23079f04 (#5489) Migrate groovy => yaml for ./e2e/yaks
d23079f04 is described below

commit d23079f04fb0d112dd0faad29ece258b87abd6fa
Author: Thomas Diesler <tdies...@redhat.com>
AuthorDate: Tue Jun 11 16:54:11 2024 +0200

    (#5489) Migrate groovy => yaml for ./e2e/yaks
---
 .github/actions/kamel-install-yaks/action.yml      |  2 +-
 e2e/knative/files/setup.sh                         |  2 +-
 .../common/apache-kamelet-catalog/logger.groovy    | 22 --------
 .../{yaks-config.yaml => logger.yaml}              | 18 +++----
 .../common/apache-kamelet-catalog/yaks-config.yaml |  6 ++-
 .../common/kamelet-binding-http/display.groovy     | 23 ---------
 .../display.yaml}                                  | 19 +++----
 .../timer-source-binding-display.yaml              |  4 +-
 .../common/kamelet-binding-http/yaks-config.yaml   |  8 ++-
 e2e/yaks/common/kamelet/source-sink.groovy         | 23 ---------
 .../yaks-config.yaml => kamelet/source-sink.yaml}  | 20 ++++----
 e2e/yaks/common/kamelet/yaks-config.yaml           |  6 ++-
 .../common/knative-sinkbinding/receiver.groovy     | 19 -------
 .../receiver.yaml}                                 | 16 ++----
 .../common/knative-sinkbinding/yaks-config.yaml    |  6 ++-
 e2e/yaks/files/setup.sh                            | 60 ++++++++++++++++++++++
 16 files changed, 114 insertions(+), 140 deletions(-)

diff --git a/.github/actions/kamel-install-yaks/action.yml 
b/.github/actions/kamel-install-yaks/action.yml
index a6babcea3..534e67913 100644
--- a/.github/actions/kamel-install-yaks/action.yml
+++ b/.github/actions/kamel-install-yaks/action.yml
@@ -21,7 +21,7 @@ description: 'Install YAKS artifacts'
 inputs:
   version:
     description: "The YAKS version"
-    default: 0.19.1
+    default: 0.19.2
     required: false
   image-name:
     description: "The YAKS operator image name"
diff --git a/e2e/knative/files/setup.sh b/e2e/knative/files/setup.sh
index 1cef680c2..34482f6e5 100755
--- a/e2e/knative/files/setup.sh
+++ b/e2e/knative/files/setup.sh
@@ -40,7 +40,7 @@ echo -n "Checking yq ... "
 if which yq > /dev/null 2>&1; then
   echo "ok"
 else
-  echo "not installed. (see https://mikefarah.gitbook.io/yq)"
+  echo "not found. (see https://mikefarah.gitbook.io/yq)"
   exit 1
 fi
 
diff --git a/e2e/yaks/common/apache-kamelet-catalog/logger.groovy 
b/e2e/yaks/common/apache-kamelet-catalog/logger.groovy
deleted file mode 100755
index 75cd5634b..000000000
--- a/e2e/yaks/common/apache-kamelet-catalog/logger.groovy
+++ /dev/null
@@ -1,22 +0,0 @@
-// camel-k: language=groovy
-
-/*
- * 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.
- */
-
-// timer-source is defined in the default Camel Kamelets catalog
-from('kamelet:timer-source?message=Camel+K')
-  .log('${body}')
diff --git a/e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml 
b/e2e/yaks/common/apache-kamelet-catalog/logger.yaml
old mode 100644
new mode 100755
similarity index 80%
copy from e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml
copy to e2e/yaks/common/apache-kamelet-catalog/logger.yaml
index ef5c6f9fb..122dc96a7
--- a/e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml
+++ b/e2e/yaks/common/apache-kamelet-catalog/logger.yaml
@@ -1,3 +1,4 @@
+# camel-k: language=yaml
 # ---------------------------------------------------------------------------
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -15,14 +16,9 @@
 # limitations under the License.
 # ---------------------------------------------------------------------------
 
-config:
-  namespace:
-    temporary: true
-pre:
-- name: installation
-  run: |
-    kamel run logger.groovy -w -n $YAKS_NAMESPACE
-post:
-  - name: print dump
-    if: env:CI=true && failure()
-    run: yaks dump --includes app=camel-k
+# timer-source is defined in the default Camel Kamelets catalog
+
+- from:
+    uri: "kamelet:timer-source?message=Camel+K"
+    steps:
+      - log: "${body}"
diff --git a/e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml 
b/e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml
index ef5c6f9fb..a9fb049de 100644
--- a/e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml
+++ b/e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml
@@ -15,13 +15,17 @@
 # limitations under the License.
 # ---------------------------------------------------------------------------
 
+# Run integration test:
+#
+# yaks run -v ./e2e/yaks/common/apache-kamelet-catalog/kamelet.feature
+
 config:
   namespace:
     temporary: true
 pre:
 - name: installation
   run: |
-    kamel run logger.groovy -w -n $YAKS_NAMESPACE
+    kamel run logger.yaml -w -n $YAKS_NAMESPACE
 post:
   - name: print dump
     if: env:CI=true && failure()
diff --git a/e2e/yaks/common/kamelet-binding-http/display.groovy 
b/e2e/yaks/common/kamelet-binding-http/display.groovy
deleted file mode 100644
index 97c879e8f..000000000
--- a/e2e/yaks/common/kamelet-binding-http/display.groovy
+++ /dev/null
@@ -1,23 +0,0 @@
-// camel-k: language=groovy
-
-/*
- * 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.
- */
-
-from('knative:endpoint/display')
-  .log('${body}')
-  .setBody().header('CamelCloudEventType')
-  .log('type: ${body}');
diff --git a/e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml 
b/e2e/yaks/common/kamelet-binding-http/display.yaml
similarity index 80%
copy from e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml
copy to e2e/yaks/common/kamelet-binding-http/display.yaml
index ef5c6f9fb..88512278e 100644
--- a/e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml
+++ b/e2e/yaks/common/kamelet-binding-http/display.yaml
@@ -1,3 +1,4 @@
+# camel-k: language=yaml
 # ---------------------------------------------------------------------------
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -15,14 +16,10 @@
 # limitations under the License.
 # ---------------------------------------------------------------------------
 
-config:
-  namespace:
-    temporary: true
-pre:
-- name: installation
-  run: |
-    kamel run logger.groovy -w -n $YAKS_NAMESPACE
-post:
-  - name: print dump
-    if: env:CI=true && failure()
-    run: yaks dump --includes app=camel-k
+- from:
+    uri: "knative:endpoint/display"
+    steps:
+      - log: "${body}"
+      - setBody:
+          simple: "${header.CamelCloudEventType}"
+      - log: "type: ${body}"
diff --git 
a/e2e/yaks/common/kamelet-binding-http/timer-source-binding-display.yaml 
b/e2e/yaks/common/kamelet-binding-http/timer-source-binding-display.yaml
index 70c9d096d..c1e3d5bff 100644
--- a/e2e/yaks/common/kamelet-binding-http/timer-source-binding-display.yaml
+++ b/e2e/yaks/common/kamelet-binding-http/timer-source-binding-display.yaml
@@ -15,8 +15,8 @@
 # limitations under the License.
 # ---------------------------------------------------------------------------
 
-apiVersion: camel.apache.org/v1alpha1
-kind: KameletBinding
+apiVersion: camel.apache.org/v1
+kind: Pipe
 metadata:
   name: timer-source-binding-display
 spec:
diff --git a/e2e/yaks/common/kamelet-binding-http/yaks-config.yaml 
b/e2e/yaks/common/kamelet-binding-http/yaks-config.yaml
index 1922bf7bb..f306f8be1 100644
--- a/e2e/yaks/common/kamelet-binding-http/yaks-config.yaml
+++ b/e2e/yaks/common/kamelet-binding-http/yaks-config.yaml
@@ -15,6 +15,10 @@
 # limitations under the License.
 # ---------------------------------------------------------------------------
 
+# Run integration test:
+#
+# yaks run -v 
./e2e/yaks/common/kamelet-binding-http/kamelet-binding-http.feature
+
 config:
   namespace:
     temporary: true
@@ -23,9 +27,9 @@ pre:
   run: |
     kubectl apply -f timer-source.kamelet.yaml -n $YAKS_NAMESPACE
 
-    kamel run display.groovy -w -n $YAKS_NAMESPACE
+    kamel run display.yaml -w -n $YAKS_NAMESPACE
     cat timer-source-binding-display.yaml | sed  
's/{namespace}/'"${YAKS_NAMESPACE}"'/' | kubectl apply -n $YAKS_NAMESPACE -f -
-    kubectl wait kameletbinding timer-source-binding-display 
--for=condition=Ready --timeout=15m -n $YAKS_NAMESPACE
+    kubectl wait pipe timer-source-binding-display --for=condition=Ready 
--timeout=15m -n $YAKS_NAMESPACE
 post:
   - name: print dump
     if: env:CI=true && failure()
diff --git a/e2e/yaks/common/kamelet/source-sink.groovy 
b/e2e/yaks/common/kamelet/source-sink.groovy
deleted file mode 100755
index e607a9fc8..000000000
--- a/e2e/yaks/common/kamelet/source-sink.groovy
+++ /dev/null
@@ -1,23 +0,0 @@
-// camel-k: language=groovy
-
-/*
- * 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.
- */
-
-from('kamelet:timer-source?message=Camel+K')
-  .to("kamelet:echo-sink")
-  .to("kamelet:echo-sink?prefix=nice+")
-  .log('${body}')
diff --git a/e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml 
b/e2e/yaks/common/kamelet/source-sink.yaml
old mode 100644
new mode 100755
similarity index 78%
copy from e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml
copy to e2e/yaks/common/kamelet/source-sink.yaml
index ef5c6f9fb..21c8473a1
--- a/e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml
+++ b/e2e/yaks/common/kamelet/source-sink.yaml
@@ -1,3 +1,4 @@
+# camel-k: language=yaml
 # ---------------------------------------------------------------------------
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -15,14 +16,11 @@
 # limitations under the License.
 # ---------------------------------------------------------------------------
 
-config:
-  namespace:
-    temporary: true
-pre:
-- name: installation
-  run: |
-    kamel run logger.groovy -w -n $YAKS_NAMESPACE
-post:
-  - name: print dump
-    if: env:CI=true && failure()
-    run: yaks dump --includes app=camel-k
+# timer-source is defined in the default Camel Kamelets catalog
+
+- from:
+    uri: "kamelet:timer-source?message=Camel+K"
+    steps:
+      - to: "kamelet:echo-sink"
+      - to: "kamelet:echo-sink?prefix=nice+"
+      - log: "${body}"
diff --git a/e2e/yaks/common/kamelet/yaks-config.yaml 
b/e2e/yaks/common/kamelet/yaks-config.yaml
index 9090b18af..44ee3ee6a 100644
--- a/e2e/yaks/common/kamelet/yaks-config.yaml
+++ b/e2e/yaks/common/kamelet/yaks-config.yaml
@@ -15,6 +15,10 @@
 # limitations under the License.
 # ---------------------------------------------------------------------------
 
+# Run integration test:
+#
+# yaks run -v ./e2e/yaks/common/kamelet/kamelet.feature
+
 config:
   namespace:
     temporary: true
@@ -23,7 +27,7 @@ pre:
   run: |
     kubectl apply -f timer-source.kamelet.yaml -n $YAKS_NAMESPACE
     kubectl apply -f echo-sink.kamelet.yaml -n $YAKS_NAMESPACE
-    kamel run source-sink.groovy -w -n $YAKS_NAMESPACE
+    kamel run source-sink.yaml -w -n $YAKS_NAMESPACE
 post:
   - name: print dump
     if: env:CI=true && failure()
diff --git a/e2e/yaks/common/knative-sinkbinding/receiver.groovy 
b/e2e/yaks/common/knative-sinkbinding/receiver.groovy
deleted file mode 100644
index 65eeb2eb9..000000000
--- a/e2e/yaks/common/knative-sinkbinding/receiver.groovy
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * 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.
- */
-
-from('knative:channel/messages')
-  .log('Received: ${body}')
diff --git a/e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml 
b/e2e/yaks/common/knative-sinkbinding/receiver.yaml
similarity index 80%
copy from e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml
copy to e2e/yaks/common/knative-sinkbinding/receiver.yaml
index ef5c6f9fb..ca9aa38bd 100644
--- a/e2e/yaks/common/apache-kamelet-catalog/yaks-config.yaml
+++ b/e2e/yaks/common/knative-sinkbinding/receiver.yaml
@@ -1,3 +1,4 @@
+# camel-k: language=yaml
 # ---------------------------------------------------------------------------
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -15,14 +16,7 @@
 # limitations under the License.
 # ---------------------------------------------------------------------------
 
-config:
-  namespace:
-    temporary: true
-pre:
-- name: installation
-  run: |
-    kamel run logger.groovy -w -n $YAKS_NAMESPACE
-post:
-  - name: print dump
-    if: env:CI=true && failure()
-    run: yaks dump --includes app=camel-k
+- from:
+    uri: "knative:channel/messages"
+    steps:
+      - log: "Received: ${body}"
diff --git a/e2e/yaks/common/knative-sinkbinding/yaks-config.yaml 
b/e2e/yaks/common/knative-sinkbinding/yaks-config.yaml
index a6cc09546..538aa6019 100644
--- a/e2e/yaks/common/knative-sinkbinding/yaks-config.yaml
+++ b/e2e/yaks/common/knative-sinkbinding/yaks-config.yaml
@@ -15,6 +15,10 @@
 # limitations under the License.
 # ---------------------------------------------------------------------------
 
+# Run integration test:
+#
+# yaks run -v ./e2e/yaks/common/knative-sinkbinding/sinkbinding.feature
+
 config:
   namespace:
     temporary: true
@@ -23,7 +27,7 @@ pre:
   run: |
     kubectl apply -n $YAKS_NAMESPACE -f messages-channel.yaml
 
-    kamel run receiver.groovy -w -n $YAKS_NAMESPACE
+    kamel run receiver.yaml -w -n $YAKS_NAMESPACE
     kamel run source.yaml -w -n $YAKS_NAMESPACE -t knative.sink-binding=true
 
     kubectl wait integration --all --for=condition=Ready --timeout=10m -n 
$YAKS_NAMESPACE
diff --git a/e2e/yaks/files/setup.sh b/e2e/yaks/files/setup.sh
new file mode 100755
index 000000000..1df6721ce
--- /dev/null
+++ b/e2e/yaks/files/setup.sh
@@ -0,0 +1,60 @@
+#!/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.
+# ---------------------------------------------------------------------------
+
+####
+#
+# This script takes care of Yaks setup
+# https://github.com/citrusframework/yaks
+#
+####
+
+YAKS_VERSION=0.19.2
+YAKS_IMAGE=docker.io/citrusframework/yaks
+
+set -e
+
+# Get the os/arch
+ARCH=$(uname -m)
+OS=$(uname -s | tr '[:upper:]' '[:lower:]')
+
+echo -n "Checking yaks ... "
+if which yaks > /dev/null 2>&1; then
+  echo "ok"
+else
+  echo "not found."
+  YAKS_BUNDLE="linux-64bit"
+  if [[ $OS == "darwin" && $ARCH == "arm64" ]]; then
+    YAKS_BUNDLE="mac-arm64bit"
+  fi
+  
YAKS_DOWNLOAD_URL="https://github.com/citrusframework/yaks/releases/download/v${YAKS_VERSION}/yaks-${YAKS_VERSION}-${YAKS_BUNDLE}.tar.gz";
+  echo "Downloading ${YAKS_DOWNLOAD_URL}" && curl -f -L ${YAKS_DOWNLOAD_URL} 
-o yaks.tar.gz
+  echo "Extracting yaks.tar.gz" && tar -zxf yaks.tar.gz
+
+  # Install the binary using the install command
+  TARGET_DIR="/usr/local/bin"
+  echo "Installing yaks-${YAKS_VERSION} to ${TARGET_DIR}"
+  sudo install -m 0755 yaks ${TARGET_DIR}
+fi
+
+echo "Installing the Yaks operator-image ${YAKS_IMAGE}:${YAKS_VERSION}"
+yaks install --operator-image ${YAKS_IMAGE}:${YAKS_VERSION}
+
+echo "Waiting for Yaks readiness ..."
+kubectl wait --for=condition=available --timeout=300s deployment/yaks-operator
+kubectl wait --for condition=Ready --timeout=300s pod -l app=yaks

Reply via email to