Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(test): test correct filtering of messages from Knative broker #2120

Merged
merged 4 commits into from Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/knative.yml
Expand Up @@ -191,7 +191,7 @@ jobs:
go-version: 1.13.x
- name: Get YAKS
run: |
export YAKS_VERSION=0.4.0-202104070030
export YAKS_VERSION=0.4.0-202104120032
curl --fail -L https://github.com/citrusframework/yaks/releases/download/${YAKS_VERSION}/yaks-${YAKS_VERSION}-linux-64bit.tar.gz -o yaks.tar.gz
tar -zxf yaks.tar.gz
sudo mv yaks /usr/local/bin/
Expand Down
53 changes: 53 additions & 0 deletions e2e/yaks/common/knative-broker/knative-broker.feature
@@ -0,0 +1,53 @@
Feature: Camel K can correctly filter messages from broker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these files need a license header?


Background:
Given create Knative broker default
Given Knative broker default is running
Given Disable auto removal of Camel-K resources
Given Disable auto removal of Kubernetes resources
Given Camel-K resource polling configuration
| maxAttempts | 60 |
| delayBetweenAttempts | 3000 |

Scenario: Integration sends messages to the broker
Given create Camel-K integration sender.groovy
"""
from('timer:tick?period=1000')
.setBody().constant('event-1')
.to('knative:event/evt1')

from('timer:tick?period=1000')
.setBody().constant('event-2')
.to('knative:event/evt2')

from('timer:tick?period=1000')
.setBody().constant('event-all')
.to('knative:event')
"""
Then Camel-K integration sender should be running


Scenario: Integration receives the correct messages from the broker
Given create Camel-K integration receiver.groovy
"""
from('knative:event/evt1')
.log('From evt1: $simple{body}')

from('knative:event/evt2')
.log('From evt2: $simple{body}')

from('knative:event')
.log('From all: $simple{body}')
"""
Then Camel-K integration receiver should be running
And Camel-K integration receiver should print From evt1: event-1
And Camel-K integration receiver should print From evt2: event-2
And Camel-K integration receiver should print From all: event-1
And Camel-K integration receiver should print From all: event-2
And Camel-K integration receiver should print From all: event-all
And Camel-K integration receiver should not print From evt1: event-2
And Camel-K integration receiver should not print From evt1: event-all
And Camel-K integration receiver should not print From evt2: event-1
And Camel-K integration receiver should not print From evt2: event-all
And delete Camel-K integration sender
And delete Camel-K integration receiver
24 changes: 24 additions & 0 deletions e2e/yaks/common/knative-broker/yaks-config.yaml
@@ -0,0 +1,24 @@
# ---------------------------------------------------------------------------
# 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.
# ---------------------------------------------------------------------------

config:
namespace:
temporary: true
pre:
- name: installation
run: |
kamel install -n $YAKS_NAMESPACE