From 4e402a038e69b4842836f1b85fe8a6102f5c0219 Mon Sep 17 00:00:00 2001 From: Christoph Deppisch Date: Tue, 16 May 2023 19:35:57 +0200 Subject: [PATCH] chore: Fix YAKS test - Force Kamelet API v1alpha1 to keep using KameletBinding resources instead of new v1 Pipe resources - Use KameletBinding resource in test to avoid incompatibilities with Kamelet API v1 version using Pipe resource instead of KameletBinding --- .github/workflows/yaks-tests.yaml | 5 ++-- test/aws-ddb-sink/yaks-config.yaml | 2 ++ test/aws-s3/aws-s3-to-http.yaml | 2 +- test/aws-s3/aws-s3-uri-binding.yaml | 2 +- test/aws-s3/yaks-config.yaml | 2 ++ test/data-type-action/yaks-config.yaml | 2 ++ test/earthquake-source/yaks-config.yaml | 2 ++ test/extract-field-action/yaks-config.yaml | 2 ++ test/insert-field-action/yaks-config.yaml | 2 ++ test/kafka/yaks-config.yaml | 2 ++ test/mail-sink/yaks-config.yaml | 2 ++ test/rest-openapi-sink/yaks-config.yaml | 2 ++ test/salesforce-sink/yaks-config.yaml | 2 ++ test/timer-source/timer-source.feature | 14 +++++----- test/timer-source/timer-to-http.yaml | 31 ++++++++++++++++++++++ test/timer-source/yaks-config.yaml | 4 +++ test/timer-to-http/yaks-config.yaml | 2 ++ 17 files changed, 69 insertions(+), 11 deletions(-) create mode 100644 test/timer-source/timer-to-http.yaml diff --git a/.github/workflows/yaks-tests.yaml b/.github/workflows/yaks-tests.yaml index 3077c74f3..146058f05 100644 --- a/.github/workflows/yaks-tests.yaml +++ b/.github/workflows/yaks-tests.yaml @@ -41,8 +41,9 @@ concurrency: cancel-in-progress: true env: - YAKS_VERSION: 0.15.0 - YAKS_RUN_OPTIONS: "--timeout=15m --local -e YAKS_CAMELK_MAX_ATTEMPTS=10 -e YAKS_JBANG_CAMEL_VERSION=4.0.0-M1 -e YAKS_JBANG_KAMELETS_LOCAL_DIR=../../../kamelets" + CAMEL_VERSION: 4.0.0-M3 + YAKS_VERSION: 0.14.2 + YAKS_RUN_OPTIONS: "--timeout=15m --local -e YAKS_CAMELK_MAX_ATTEMPTS=10 -e YAKS_JBANG_CAMEL_VERSION=${CAMEL_VERSION} -e YAKS_JBANG_KAMELETS_LOCAL_DIR=../../../kamelets" jobs: test: diff --git a/test/aws-ddb-sink/yaks-config.yaml b/test/aws-ddb-sink/yaks-config.yaml index c3fe02325..6fac81be9 100644 --- a/test/aws-ddb-sink/yaks-config.yaml +++ b/test/aws-ddb-sink/yaks-config.yaml @@ -22,6 +22,8 @@ config: testcontainers: enabled: true env: + - name: YAKS_CAMELK_KAMELET_API_VERSION + value: v1alpha1 - name: YAKS_CAMEL_AUTO_REMOVE_RESOURCES value: false - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES diff --git a/test/aws-s3/aws-s3-to-http.yaml b/test/aws-s3/aws-s3-to-http.yaml index 1a7b931d9..798ecde93 100644 --- a/test/aws-s3/aws-s3-to-http.yaml +++ b/test/aws-s3/aws-s3-to-http.yaml @@ -28,7 +28,7 @@ spec: properties: bucketNameOrArn: ${aws.s3.bucketNameOrArn} overrideEndpoint: true - uriEndpointOverride: ${YAKS_TESTCONTAINERS_LOCALSTACK_S3_URL} + uriEndpointOverride: ${YAKS_TESTCONTAINERS_LOCALSTACK_S3_LOCAL_URL} accessKey: ${YAKS_TESTCONTAINERS_LOCALSTACK_ACCESS_KEY} secretKey: ${YAKS_TESTCONTAINERS_LOCALSTACK_SECRET_KEY} region: ${YAKS_TESTCONTAINERS_LOCALSTACK_REGION} diff --git a/test/aws-s3/aws-s3-uri-binding.yaml b/test/aws-s3/aws-s3-uri-binding.yaml index b3612219f..3779545af 100644 --- a/test/aws-s3/aws-s3-uri-binding.yaml +++ b/test/aws-s3/aws-s3-uri-binding.yaml @@ -28,7 +28,7 @@ spec: properties: bucketNameOrArn: ${aws.s3.bucketNameOrArn} overrideEndpoint: true - uriEndpointOverride: ${YAKS_TESTCONTAINERS_LOCALSTACK_S3_URL} + uriEndpointOverride: ${YAKS_TESTCONTAINERS_LOCALSTACK_S3_LOCAL_URL} accessKey: ${YAKS_TESTCONTAINERS_LOCALSTACK_ACCESS_KEY} secretKey: ${YAKS_TESTCONTAINERS_LOCALSTACK_SECRET_KEY} region: ${YAKS_TESTCONTAINERS_LOCALSTACK_REGION} diff --git a/test/aws-s3/yaks-config.yaml b/test/aws-s3/yaks-config.yaml index ccbb58d79..ec2b8274c 100644 --- a/test/aws-s3/yaks-config.yaml +++ b/test/aws-s3/yaks-config.yaml @@ -22,6 +22,8 @@ config: testcontainers: enabled: true env: + - name: YAKS_CAMELK_KAMELET_API_VERSION + value: v1alpha1 - name: YAKS_CAMEL_AUTO_REMOVE_RESOURCES value: false - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES diff --git a/test/data-type-action/yaks-config.yaml b/test/data-type-action/yaks-config.yaml index a0b3d5902..0dbe5aea5 100644 --- a/test/data-type-action/yaks-config.yaml +++ b/test/data-type-action/yaks-config.yaml @@ -20,6 +20,8 @@ config: temporary: false runtime: env: + - name: YAKS_CAMELK_KAMELET_API_VERSION + value: v1alpha1 - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES value: false - name: YAKS_KUBERNETES_AUTO_REMOVE_RESOURCES diff --git a/test/earthquake-source/yaks-config.yaml b/test/earthquake-source/yaks-config.yaml index 9977b154e..d9d3e8f06 100644 --- a/test/earthquake-source/yaks-config.yaml +++ b/test/earthquake-source/yaks-config.yaml @@ -20,6 +20,8 @@ config: temporary: false runtime: env: + - name: YAKS_CAMELK_KAMELET_API_VERSION + value: v1alpha1 - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES value: false - name: YAKS_KUBERNETES_AUTO_REMOVE_RESOURCES diff --git a/test/extract-field-action/yaks-config.yaml b/test/extract-field-action/yaks-config.yaml index ed24e26ef..26a046f8f 100644 --- a/test/extract-field-action/yaks-config.yaml +++ b/test/extract-field-action/yaks-config.yaml @@ -20,6 +20,8 @@ config: temporary: false runtime: env: + - name: YAKS_CAMELK_KAMELET_API_VERSION + value: v1alpha1 - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES value: false - name: YAKS_KUBERNETES_AUTO_REMOVE_RESOURCES diff --git a/test/insert-field-action/yaks-config.yaml b/test/insert-field-action/yaks-config.yaml index fd4059a54..cbb7be89d 100644 --- a/test/insert-field-action/yaks-config.yaml +++ b/test/insert-field-action/yaks-config.yaml @@ -20,6 +20,8 @@ config: temporary: false runtime: env: + - name: YAKS_CAMELK_KAMELET_API_VERSION + value: v1alpha1 - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES value: false - name: YAKS_KUBERNETES_AUTO_REMOVE_RESOURCES diff --git a/test/kafka/yaks-config.yaml b/test/kafka/yaks-config.yaml index adfa773a3..a91e4a595 100644 --- a/test/kafka/yaks-config.yaml +++ b/test/kafka/yaks-config.yaml @@ -20,6 +20,8 @@ config: temporary: false runtime: env: + - name: YAKS_CAMELK_KAMELET_API_VERSION + value: v1alpha1 - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES value: false - name: YAKS_KUBERNETES_AUTO_REMOVE_RESOURCES diff --git a/test/mail-sink/yaks-config.yaml b/test/mail-sink/yaks-config.yaml index db3ee83b1..8a9663670 100644 --- a/test/mail-sink/yaks-config.yaml +++ b/test/mail-sink/yaks-config.yaml @@ -20,6 +20,8 @@ config: temporary: false runtime: env: + - name: YAKS_CAMELK_KAMELET_API_VERSION + value: v1alpha1 - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES value: false - name: YAKS_KUBERNETES_AUTO_REMOVE_RESOURCES diff --git a/test/rest-openapi-sink/yaks-config.yaml b/test/rest-openapi-sink/yaks-config.yaml index 9a99d565e..936131c68 100644 --- a/test/rest-openapi-sink/yaks-config.yaml +++ b/test/rest-openapi-sink/yaks-config.yaml @@ -20,6 +20,8 @@ config: temporary: false runtime: env: + - name: YAKS_CAMELK_KAMELET_API_VERSION + value: v1alpha1 - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES value: false - name: YAKS_KUBERNETES_AUTO_REMOVE_RESOURCES diff --git a/test/salesforce-sink/yaks-config.yaml b/test/salesforce-sink/yaks-config.yaml index 246d85b1d..0134cd57c 100644 --- a/test/salesforce-sink/yaks-config.yaml +++ b/test/salesforce-sink/yaks-config.yaml @@ -20,6 +20,8 @@ config: temporary: false runtime: env: + - name: YAKS_CAMELK_KAMELET_API_VERSION + value: v1alpha1 - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES value: false - name: YAKS_KUBERNETES_AUTO_REMOVE_RESOURCES diff --git a/test/timer-source/timer-source.feature b/test/timer-source/timer-source.feature index 50053518c..0582b8678 100644 --- a/test/timer-source/timer-source.feature +++ b/test/timer-source/timer-source.feature @@ -25,13 +25,13 @@ Feature: Timer Source Kamelet Given create Kubernetes service test-service with target port 8080 Scenario: Create Kamelet binding - And KameletBinding source properties + Given Kamelet API version v1alpha1 + And variables | message | Hello World | - And bind Kamelet timer-source to uri yaks:resolveURL('test-service')/events - When create KameletBinding timer-source-binding - Then KameletBinding timer-source-binding should be available - Then Camel K integration timer-source-binding should be running - And Camel K integration timer-source-binding should print Routes startup + Given load KameletBinding timer-to-http.yaml + Then KameletBinding timer-to-http should be available + Then Camel K integration timer-to-http should be running + And Camel K integration timer-to-http should print Routes startup Scenario: Verify binding Given expect HTTP request body: Hello World @@ -39,5 +39,5 @@ Feature: Timer Source Kamelet Then send HTTP 200 OK Scenario: Remove Camel K resources - Given delete KameletBinding timer-source-binding + Given delete KameletBinding timer-to-http And delete Kubernetes service test-service diff --git a/test/timer-source/timer-to-http.yaml b/test/timer-source/timer-to-http.yaml new file mode 100644 index 000000000..16a34bb72 --- /dev/null +++ b/test/timer-source/timer-to-http.yaml @@ -0,0 +1,31 @@ +# --------------------------------------------------------------------------- +# 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. +# --------------------------------------------------------------------------- + +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: timer-to-mail +spec: + source: + ref: + kind: Kamelet + apiVersion: camel.apache.org/v1alpha1 + name: timer-source + properties: + message: "${message}" + sink: + uri: yaks:resolveURL('test-service')/events diff --git a/test/timer-source/yaks-config.yaml b/test/timer-source/yaks-config.yaml index 9977b154e..dfa40a51c 100644 --- a/test/timer-source/yaks-config.yaml +++ b/test/timer-source/yaks-config.yaml @@ -20,6 +20,8 @@ config: temporary: false runtime: env: + - name: YAKS_CAMELK_KAMELET_API_VERSION + value: v1alpha1 - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES value: false - name: YAKS_KUBERNETES_AUTO_REMOVE_RESOURCES @@ -32,6 +34,8 @@ config: level: INFO - name: INTEGRATION_LOGS level: INFO + resources: + - timer-to-http.yaml dump: enabled: true failedOnly: true diff --git a/test/timer-to-http/yaks-config.yaml b/test/timer-to-http/yaks-config.yaml index a7387ea3f..9a6718e33 100644 --- a/test/timer-to-http/yaks-config.yaml +++ b/test/timer-to-http/yaks-config.yaml @@ -20,6 +20,8 @@ config: temporary: false runtime: env: + - name: YAKS_CAMELK_KAMELET_API_VERSION + value: v1alpha1 - name: YAKS_JBANG_CAMEL_DUMP_INTEGRATION_OUTPUT value: true settings: