This repository was archived by the owner on Mar 27, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 20
Functional tests #276
Merged
Merged
Functional tests #276
Conversation
This file contains hidden or 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
Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
This test is a functional test running locally using a properly env in with docker and mosquitto. Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
Add MqttSendAndReceiveTimeout helper to verify if the expected response comes before a timeout expires Signed-off-by: Fabio Falzoi <fabio@develer.com>
Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
I added a ctor for a local MQTT configuration for type MqttTestClient in order to other tests working as is. Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
Adding this we can check real output on machine. The assert is only on second line of output because first line is a docker header. Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
Signed-off-by: Fabio Falzoi <fabio@develer.com>
Signed-off-by: Fabio Falzoi <fabio@develer.com>
Signed-off-by: Fabio Falzoi <fabio@develer.com>
Signed-off-by: Fabio Falzoi <fabio@develer.com>
Signed-off-by: Fabio Falzoi <fabio@develer.com>
Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
In this case I removed different implementation used to post on aws or in local test. Now is more clean using only callback. Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
In this case I use to check real docker ps -a command called with exec and msg from mqtt, I want check len of array of docker container in machine. Using this we are uncoupled from status of machine container but the focus is on correctly respond by production code of application. Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
Signed-off-by: Fabio Falzoi <fabio@develer.com>
Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
rsora
approved these changes
Jul 23, 2020
Contributor
rsora
left a comment
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.
👍
pippolo84
suggested changes
Jul 23, 2020
pippolo84
left a comment
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 suggested some fixes for minor/style issues. Please review them and give feedback if needed.
Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
Signed-off-by: Federico Guerinoni <fguerinoni@develer.com>
pippolo84
approved these changes
Jul 23, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The purpose of this PR is to add a structure for running locally functional tests about API.
For this, we are using a docker image while developing in order to have a reproducible environment also for CI on GitHub, the link for image https://hub.docker.com/r/guerra1994/go-mqtt-docker-env.
The documentation is updated also about running tests in local machines.
I just added a test for
docker ps -aAPI and it checks the output of the command executed on bash and the message from broker MQTT. It allows us to avoid to follow a sequential order running tests but is consistent with what container are in the machine because it checks that 2 output figure out the same container id.In order to automate steps explained in README.md there is a script that starts
mosquitto, exec tests and kills it, to restore a correct state of the docker container.