-
Notifications
You must be signed in to change notification settings - Fork 161
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
Test dockerization #2234
Test dockerization #2234
Conversation
assembly/broker/docker/Dockerfile
Outdated
@@ -39,7 +39,7 @@ ENV ACTIVEMQ_OPTS "-Dcommons.db.schema.update=true \ | |||
-Dcommons.eventbus.url=\${SERVICE_BROKER_ADDR} \ | |||
-Dcertificate.jwt.private.key=file:///var/opt/activemq/key.pk8 \ | |||
-Dcertificate.jwt.certificate=file:///var/opt/activemq/cert.pem \ | |||
-Dbroker.ip=broker" | |||
-Dbroker.ip=localhost" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @muros-ct,
Have you also tried a Docker Compose deployment with this setting? I suspect it may lead to some issues...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try another docker build and try it again. I think that it didn't work with broker. Because it sets device broker to broker instead of actual broker address.
What exactly does broker mean in this case? It should be ip or dns name. Right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It actually gets resolved by Docker Compose to the ip address of the broker, since they're in the same Compose template
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried with broker as broker.ip.
Problem is that broker name is matched to broker ip only inside docker. But if I connect external device to that broker then device tries to communicate with broker by this name. But because device itself is not inside docker it can't connect to broker as it doesn't exist outside, where device is.
Now to approach this issue?
I get this error in integration test:
[ERROR] Scenario: Send BIRTH message and then DC message Time elapsed: 0.017 s <<< ERROR!
org.eclipse.kapua.service.device.call.kura.exception.KuraMqttDeviceCallException: Error:
Caused by: org.eclipse.kapua.service.device.call.kura.exception.KuraMqttDeviceCallException: Error:
Caused by: org.eclipse.kapua.KapuaException: An internal error occurred: {0}.
Caused by: org.eclipse.kapua.transport.mqtt.MqttClientException: Error: tcp://broker:1883,KapuaPool-1544111357250-7243724233515380736,kapua-sys
Caused by: org.eclipse.paho.client.mqttv3.MqttException: MqttException
Caused by: java.net.UnknownHostException: broker
`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LeoNerdoG can you please check my branch for this PR.
Does dockers still run? Especially, can a device connect to Kapua and can you issue commands on that device?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LeoNerdoG No need to check I reverted broker.ip back to broker.
@lorthirk You are right, I set the broker.ip to broker. The problem is that I want to have same tests for dockerized and local environment, and some just can't be run in combination.
Also some test scenarios are still written for embedded broker and are using localhost keyword in scenario itself. I will fix those in another PR.
Codecov Report
@@ Coverage Diff @@
## develop #2234 +/- ##
=============================================
- Coverage 57.42% 55.97% -1.46%
+ Complexity 1584 1555 -29
=============================================
Files 1071 1071
Lines 26010 26063 +53
Branches 2299 2301 +2
=============================================
- Hits 14936 14588 -348
- Misses 10093 10507 +414
+ Partials 981 968 -13
Continue to review full report at Codecov.
|
673794e
to
05f1f88
Compare
@Coduz and @lorthirk Do you think we can merge this. |
05f1f88
to
9ad105c
Compare
Integration tests were refactored to a degree that they can be run with dockerized environment of Kapua. Database, ES, console, broker, API all are run in docker. Tests connect to those in run as full integration or functional tests. This refactoring didn't changed the integration tests with embedded infrastructure, meaning that both approaches can be used. Read RunTests.md for usage. Signed-off-by: Uros Mesaric Kunst <uros.mesaric-kunst@comtrade.com>
integration tests. Broker for docker is returned back to way it was before change, using broker.ip as broker and not localhost. Signed-off-by: Uros Mesaric Kunst <uros.mesaric-kunst@comtrade.com>
9ad105c
to
7fe81a1
Compare
If everyone is OK, I would merge this changes. |
Added support for integration tests with docker for Kapua deployment
Related Issue
None
Description of the solution adopted
Integration and/or functional tests can now be run either with embedded servers or with servers running in dockers. With servers I mean ES, DB, console, broker and API.
Screenshots
Not applicable.
Any side note on the changes made
Tests with embedded servers are still successfully run on Travis and Jenkins.