Skip to content

Commit

Permalink
fix: Fix YAKS tests
Browse files Browse the repository at this point in the history
- Update expected Json returned from OpenAQ API
- Update ActiveMQ Artemis to version v1.0.14 in tests
- Use specific ActiveMQ Artemis broker instance in tests
- Fix user report system endpoint URL
  • Loading branch information
christophd committed Aug 23, 2023
1 parent 68dfdd0 commit 74e37a3
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 6 deletions.
7 changes: 6 additions & 1 deletion test/consumers/OpenAQConsumer.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@ Feature: OpenAQ consumer test
And expect Kafka message with body
"""
{
"locationId": "@assertThat(nullValue())@",
"location": "@assertThat(notNullValue())@",
"parameter": "@assertThat(notNullValue())@",
"date": "@assertThat(notNullValue())@",
"value": "@assertThat(notNullValue())@",
"unit": "@assertThat(notNullValue())@",
"coordinates": "@assertThat(notNullValue())@",
"country": "@assertThat(notNullValue())@",
"city": "@assertThat(notNullValue())@"
"city": "@assertThat(notNullValue())@",
"isMobile": "@assertThat(nullValue())@",
"isAnalysis": "@assertThat(nullValue())@",
"entity": "@assertThat(nullValue())@",
"sensorType": "@assertThat(nullValue())@"
}
"""

Expand Down
23 changes: 23 additions & 0 deletions test/infra/amq-broker-instance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: broker.amq.io/v1beta1
kind: ActiveMQArtemis
metadata:
name: broker
spec:
acceptors:
- name: artemis_acceptor
protocols: 'artemis,core,openwire'
port: 61616
sslEnabled: false
- name: amqp_acceptor
protocols: amqp
port: 5672
sslEnabled: false
deploymentPlan:
size: 1
persistenceEnabled: false
requireLogin: false
messageMigration: false
managementRBACEnabled: true
journalType: nio
jolokiaAgentEnabled: false
image: placeholder
6 changes: 3 additions & 3 deletions test/scripts/install-amq-broker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ waitFor() {
}

SOURCE=$(dirname "$0")
INFRA="${SOURCE}"/../../infra
ACTIVEMQ_VERSION=v0.19.3
INFRA="${SOURCE}"/../infra
ACTIVEMQ_VERSION=v1.0.14
URL="https://raw.githubusercontent.com/artemiscloud/activemq-artemis-operator/${ACTIVEMQ_VERSION}"

BROKER=$(kubectl get activemqartemis/broker -n ${YAKS_NAMESPACE} || echo "")
Expand All @@ -51,7 +51,7 @@ if [ -z "$BROKER" ]; then
waitFor kubectl wait pod -l name=activemq-artemis-operator --for condition=Ready --timeout=60s -n ${YAKS_NAMESPACE}

# Create AMQ broker
kubectl create -f "${INFRA}"/messaging/broker/instances/amq-broker-instance.yaml -n ${YAKS_NAMESPACE}
kubectl create -f "${INFRA}"/amq-broker-instance.yaml -n ${YAKS_NAMESPACE}

# wait for broker to start
waitFor kubectl wait pod -l ActiveMQArtemis=broker --for condition=Ready --timeout=60s -n ${YAKS_NAMESPACE}
Expand Down
4 changes: 3 additions & 1 deletion test/user-report/UserReportCrime.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: User report and gate-keeper component test

Background:
Given URL: http://user-report-system.${YAKS_NAMESPACE}.svc.cluster.local
Given URL: http://user-report-system.${YAKS_NAMESPACE}
Given HTTP request timeout is 60000 ms
Given load variables application-test.properties
Given variables
Expand All @@ -19,12 +19,14 @@ Feature: User report and gate-keeper component test
When load Camel K integration UserReportSystem.java with configuration
| traits | knative-service.min-scale=1 |
Then Camel K integration user-report-system should be running
Then Camel K integration user-report-system should print Listening on

Scenario: Run GateKeeper Camel K integration
Given Camel K integration property file application-test.properties
When load Camel K integration GateKeeper.java with configuration
| traits | knative-service.min-scale=1 |
Given Camel K integration gate-keeper should be running
Then Camel K integration gate-keeper should print Listening on

Scenario: Crime report is send to crime-data topic
Given variable user is "user1"
Expand Down
4 changes: 3 additions & 1 deletion test/user-report/UserReportHealth.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Health user report and gate-keeper component test

Background:
Given URL: http://user-report-system.${YAKS_NAMESPACE}.svc.cluster.local
Given URL: http://user-report-system.${YAKS_NAMESPACE}
Given HTTP request timeout is 60000 ms
Given load variables application-test.properties
Given variables
Expand All @@ -19,12 +19,14 @@ Feature: Health user report and gate-keeper component test
When load Camel K integration UserReportSystem.java with configuration
| traits | knative-service.min-scale=1 |
Then Camel K integration user-report-system should be running
Then Camel K integration user-report-system should print Listening on

Scenario: Run GateKeeper Camel K integration
Given Camel K integration property file application-test.properties
When load Camel K integration GateKeeper.java with configuration
| traits | knative-service.min-scale=1 |
Given Camel K integration gate-keeper should be running
Then Camel K integration gate-keeper should print Listening on

Scenario: Health report is send to health-data topic
Given variable user is "user1"
Expand Down

0 comments on commit 74e37a3

Please sign in to comment.