-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Use proper yaks-config conventions - Use YAKS dump functionality in case of failure - Move Camel K installation steps to workflow - Apply all current Kamelets at once in workflow prior to running the tests - Keep pre/post test scripts as simple as possible - Use Camel K 1.8.2 (fixes earthquake-source CI test)
- Loading branch information
1 parent
4781423
commit 33316ec
Showing
11 changed files
with
158 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,27 @@ | ||
Feature: Kamelet earthquake-source works | ||
Feature: Kamelet earthquake-source | ||
|
||
Background: | ||
Given Disable auto removal of Kamelet resources | ||
Given Disable auto removal of Kubernetes resources | ||
Given Camel K resource polling configuration | ||
| maxAttempts | 60 | | ||
| delayBetweenAttempts | 3000 | | ||
Given HTTP server timeout is 15000 ms | ||
Given HTTP server "test-service" | ||
|
||
Scenario: Bind Kamelet to service | ||
Scenario: Create Http server | ||
Given create Kubernetes service test-service with target port 8080 | ||
And bind Kamelet earthquake-source to uri http://test-service.${YAKS_NAMESPACE}.svc.cluster.local/test | ||
When create KameletBinding earthquake-source-uri | ||
|
||
Scenario: Create Kamelet binding | ||
Given Camel K resource polling configuration | ||
| maxAttempts | 200 | | ||
| delayBetweenAttempts | 2000 | | ||
When bind Kamelet earthquake-source to uri http://test-service.${YAKS_NAMESPACE}/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 | ||
And Camel K integration earthquake-source-uri should print Routes startup | ||
|
||
Scenario: Verify binding | ||
Given HTTP server "test-service" | ||
And HTTP server timeout is 120000 ms | ||
Then expect HTTP request header: Content-Type="application/json;charset=UTF-8" | ||
And receive POST /test | ||
And delete KameletBinding earthquake-source-uri | ||
Given expect HTTP request header: Content-Type="application/json;charset=UTF-8" | ||
When receive POST /test | ||
Then send HTTP 200 OK | ||
|
||
Scenario: Remove Camel K resources | ||
Given delete KameletBinding earthquake-source-uri | ||
And delete Kubernetes service test-service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 14 additions & 12 deletions
26
test/insert-field-action/insert-field-action-binding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
kind: KameletBinding | ||
apiVersion: camel.apache.org/v1alpha1 | ||
kind: KameletBinding | ||
metadata: | ||
name: insert-field-action-binding | ||
spec: | ||
source: | ||
ref: | ||
apiVersion: camel.apache.org/v1alpha1 | ||
kind: Kamelet | ||
apiVersion: camel.apache.org/v1alpha1 | ||
name: timer-source | ||
properties: | ||
message: '{"content": "thecontent"}' | ||
contentType: "application/json" | ||
period: 5000 | ||
contentType: application/json | ||
message: > | ||
${input} | ||
steps: | ||
- ref: | ||
apiVersion: camel.apache.org/v1alpha1 | ||
kind: Kamelet | ||
name: insert-field-action | ||
properties: | ||
field: "thefield" | ||
value: "thevalue" | ||
- ref: | ||
kind: Kamelet | ||
apiVersion: camel.apache.org/v1alpha1 | ||
name: insert-field-action | ||
properties: | ||
field: ${field} | ||
value: ${value} | ||
sink: | ||
uri: http://probe-service/events | ||
uri: http://test-insert-service.${YAKS_NAMESPACE}/result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,36 @@ | ||
Feature: Timer Source Kamelet | ||
Feature: Insert field Kamelet action | ||
|
||
Background: | ||
Given Disable auto removal of Kamelet resources | ||
Given Disable auto removal of Kubernetes resources | ||
Given Camel K resource polling configuration | ||
| maxAttempts | 60 | | ||
| delayBetweenAttempts | 3000 | | ||
Given HTTP server timeout is 15000 ms | ||
Given HTTP server "test-insert-service" | ||
Given variables | ||
| field | subject | | ||
| value | Camel K rocks! | | ||
|
||
Scenario: Create Http server | ||
Given create Kubernetes service test-insert-service with target port 8080 | ||
|
||
Scenario: Wait for binding to start | ||
Given create Kubernetes service probe-service with target port 8080 | ||
Scenario: Create Kamelet binding | ||
Given Camel K resource polling configuration | ||
| maxAttempts | 200 | | ||
| delayBetweenAttempts | 2000 | | ||
Given variable input is | ||
""" | ||
{ "id": "citrus:randomUUID()" } | ||
""" | ||
When load KameletBinding insert-field-action-binding.yaml | ||
Then Camel K integration insert-field-action-binding should be running | ||
And Camel K integration insert-field-action-binding should print Routes startup | ||
|
||
Scenario: Verify binding | ||
Given HTTP server "probe-service" | ||
And HTTP server timeout is 300000 ms | ||
Then expect HTTP request body | ||
Scenario: Verify output message sent | ||
Given expect HTTP request body | ||
""" | ||
{ | ||
"content": "thecontent", | ||
"thefield": "thevalue" | ||
} | ||
{ "id": "@ignore@", "${field}": "${value}" } | ||
""" | ||
And expect HTTP request header: Content-Type="application/json;charset=UTF-8" | ||
And receive POST /events | ||
And delete KameletBinding insert-field-action-binding | ||
And HTTP request header Content-Type="application/json" | ||
When receive POST /result | ||
Then send HTTP 200 OK | ||
|
||
Scenario: Remove resources | ||
Given delete KameletBinding insert-field-action-binding | ||
And delete Kubernetes service test-insert-service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
Feature: Timer Source Kamelet | ||
|
||
Background: | ||
Given Disable auto removal of Kamelet resources | ||
Given Disable auto removal of Kubernetes resources | ||
Given Camel K resource polling configuration | ||
| maxAttempts | 20 | | ||
| delayBetweenAttempts | 1000 | | ||
Given HTTP server timeout is 15000 ms | ||
Given HTTP server "probe-service" | ||
|
||
Scenario: Bind Kamelet to service | ||
Scenario: Create Http server | ||
Given create Kubernetes service probe-service with target port 8080 | ||
|
||
Scenario: Create Kamelet binding | ||
Given Camel K resource polling configuration | ||
| maxAttempts | 200 | | ||
| delayBetweenAttempts | 2000 | | ||
And KameletBinding source properties | ||
| message | Hello World | | ||
And bind Kamelet timer-source to uri http://probe-service.${YAKS_NAMESPACE}/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 | ||
|
||
Scenario: Verify binding | ||
Given HTTP server "probe-service" | ||
And HTTP server timeout is 300000 ms | ||
Then expect HTTP request body: Hello World | ||
And receive POST /events | ||
And delete KameletBinding timer-source-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 | ||
And delete Kubernetes service probe-service |
Oops, something went wrong.