Skip to content

Commit

Permalink
chore: Fix YAKS test
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
christophd committed May 16, 2023
1 parent a1ba8e5 commit 4e402a0
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 11 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/yaks-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions test/aws-ddb-sink/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/aws-s3/aws-s3-to-http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion test/aws-s3/aws-s3-uri-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 2 additions & 0 deletions test/aws-s3/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/data-type-action/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/earthquake-source/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/extract-field-action/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/insert-field-action/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/kafka/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/mail-sink/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/rest-openapi-sink/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/salesforce-sink/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions test/timer-source/timer-source.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ 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
When receive POST /events
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
31 changes: 31 additions & 0 deletions test/timer-source/timer-to-http.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions test/timer-source/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,6 +34,8 @@ config:
level: INFO
- name: INTEGRATION_LOGS
level: INFO
resources:
- timer-to-http.yaml
dump:
enabled: true
failedOnly: true
Expand Down
2 changes: 2 additions & 0 deletions test/timer-to-http/yaks-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4e402a0

Please sign in to comment.