You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2023/05/25 13:54:16 UTC

[camel-kamelets] branch main updated: chore: Improve YAKS tests

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

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


The following commit(s) were added to refs/heads/main by this push:
     new f5cfd0d8 chore: Improve YAKS tests
f5cfd0d8 is described below

commit f5cfd0d8c1e3341d859a7ff6440674b9f7254255
Author: Christoph Deppisch <cd...@redhat.com>
AuthorDate: Wed May 24 20:03:11 2023 +0200

    chore: Improve YAKS tests
    
    - Use KameletBinding yaml file resource instead of YAKS bind step
---
 test/earthquake-source/earthquake-source.feature   | 10 +++---
 .../{yaks-config.yaml => earthquake-to-http.yaml}  | 34 ++++++++------------
 test/earthquake-source/yaks-config.yaml            |  2 ++
 test/timer-source/timer-source.feature             | 15 +++++----
 .../timer-to-http.yaml}                            | 36 +++++++++-------------
 test/timer-source/yaks-config.yaml                 |  2 ++
 6 files changed, 42 insertions(+), 57 deletions(-)

diff --git a/test/earthquake-source/earthquake-source.feature b/test/earthquake-source/earthquake-source.feature
index 92ea6807..fdb6ef6f 100644
--- a/test/earthquake-source/earthquake-source.feature
+++ b/test/earthquake-source/earthquake-source.feature
@@ -25,10 +25,10 @@ Feature: Kamelet earthquake-source
     Given create Kubernetes service test-service with target port 8080
 
   Scenario: Create Kamelet binding
-    When bind Kamelet earthquake-source to uri yaks:resolveURL('test-service')/test
-    And create KameletBinding earthquake-source-uri
-    Then KameletBinding earthquake-source-uri should be available
-    Then Camel K integration earthquake-source-uri should be running
+    Given load KameletBinding earthquake-to-http.yaml
+    Then KameletBinding earthquake-to-http should be available
+    Then Camel K integration earthquake-to-http should be running
+    And Camel K integration earthquake-to-http should print Routes startup
 
   Scenario: Verify binding
     Given expect HTTP request header: Content-Type="application/json;charset=UTF-8"
@@ -36,5 +36,5 @@ Feature: Kamelet earthquake-source
     Then send HTTP 200 OK
 
   Scenario: Remove Camel K resources
-    Given delete KameletBinding earthquake-source-uri
+    Given delete KameletBinding earthquake-to-http
     And delete Kubernetes service test-service
diff --git a/test/earthquake-source/yaks-config.yaml b/test/earthquake-source/earthquake-to-http.yaml
similarity index 65%
copy from test/earthquake-source/yaks-config.yaml
copy to test/earthquake-source/earthquake-to-http.yaml
index 9977b154..d5baa578 100644
--- a/test/earthquake-source/yaks-config.yaml
+++ b/test/earthquake-source/earthquake-to-http.yaml
@@ -15,25 +15,15 @@
 # limitations under the License.
 # ---------------------------------------------------------------------------
 
-config:
-  namespace:
-    temporary: false
-  runtime:
-    env:
-      - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES
-        value: false
-      - name: YAKS_KUBERNETES_AUTO_REMOVE_RESOURCES
-        value: false
-      - name: YAKS_JBANG_CAMEL_DUMP_INTEGRATION_OUTPUT
-        value: true
-    settings:
-      loggers:
-        - name: INTEGRATION_STATUS
-          level: INFO
-        - name: INTEGRATION_LOGS
-          level: INFO
-  dump:
-    enabled: true
-    failedOnly: true
-    includes:
-      - app=camel-k
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: earthquake-to-http
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: earthquake-source
+  sink:
+    uri: yaks:resolveURL('test-service')/test
diff --git a/test/earthquake-source/yaks-config.yaml b/test/earthquake-source/yaks-config.yaml
index 9977b154..d54cb7ac 100644
--- a/test/earthquake-source/yaks-config.yaml
+++ b/test/earthquake-source/yaks-config.yaml
@@ -32,6 +32,8 @@ config:
           level: INFO
         - name: INTEGRATION_LOGS
           level: INFO
+    resources:
+      - earthquake-to-http.yaml
   dump:
     enabled: true
     failedOnly: true
diff --git a/test/timer-source/timer-source.feature b/test/timer-source/timer-source.feature
index 50053518..89f491bf 100644
--- a/test/timer-source/timer-source.feature
+++ b/test/timer-source/timer-source.feature
@@ -18,20 +18,19 @@
 Feature: Timer Source Kamelet
 
   Background:
-    Given HTTP server timeout is 15000 ms
+    Given HTTP server timeout is 150000 ms
     Given HTTP server "test-service"
 
   Scenario: Create Http server
     Given create Kubernetes service test-service with target port 8080
 
   Scenario: Create Kamelet binding
-    And KameletBinding source properties
+    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 +38,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/earthquake-source/yaks-config.yaml b/test/timer-source/timer-to-http.yaml
similarity index 65%
copy from test/earthquake-source/yaks-config.yaml
copy to test/timer-source/timer-to-http.yaml
index 9977b154..35a15822 100644
--- a/test/earthquake-source/yaks-config.yaml
+++ b/test/timer-source/timer-to-http.yaml
@@ -15,25 +15,17 @@
 # limitations under the License.
 # ---------------------------------------------------------------------------
 
-config:
-  namespace:
-    temporary: false
-  runtime:
-    env:
-      - name: YAKS_CAMELK_AUTO_REMOVE_RESOURCES
-        value: false
-      - name: YAKS_KUBERNETES_AUTO_REMOVE_RESOURCES
-        value: false
-      - name: YAKS_JBANG_CAMEL_DUMP_INTEGRATION_OUTPUT
-        value: true
-    settings:
-      loggers:
-        - name: INTEGRATION_STATUS
-          level: INFO
-        - name: INTEGRATION_LOGS
-          level: INFO
-  dump:
-    enabled: true
-    failedOnly: true
-    includes:
-      - app=camel-k
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: timer-to-http
+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 9977b154..dd0b980d 100644
--- a/test/timer-source/yaks-config.yaml
+++ b/test/timer-source/yaks-config.yaml
@@ -32,6 +32,8 @@ config:
           level: INFO
         - name: INTEGRATION_LOGS
           level: INFO
+    resources:
+      - timer-to-http.yaml
   dump:
     enabled: true
     failedOnly: true