-
Notifications
You must be signed in to change notification settings - Fork 17
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
AG-22 - Add Agent Tests #58
Open
SammyOina
wants to merge
26
commits into
mainflux:master
Choose a base branch
from
SammyOina:tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
Add tests for NewHeartbeat and Update functions ``` This commit adds tests for the `NewHeartbeat` and `Update` functions in the `agent` package. The `NewHeartbeat` test checks if the `NewHeartbeat` function correctly initializes a new heartbeat with the given name, service type, and interval. It also verifies the initial status and info of the heartbeat. Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Fix error when writing to TOML file The commit fixes an error that occurs when writing to a TOML file. The error is wrapped with a custom error message. This ensures that the error is properly handled and provides more context to the developer. The commit also includes changes to the import statements in the bootstrap.go file. Signed-off-by: SammyOina <[email protected]>
The commit fixes error handling in the bootstrap_test.go file by checking for an error when writing the response body. This ensures that any errors are properly handled and reported. Signed-off-by: SammyOina <[email protected]>
…sten function Signed-off-by: SammyOina <[email protected]>
The `Info()` method in the `Heartbeat` interface was not thread-safe, which could lead to a race condition when accessing the `info` field. To fix this issue, a mutex was added to protect the access to `info` and ensure thread safety. The `Info()` method now locks the mutex before accessing `info` and unlocks it before returning the value. Additionally, a new `Close()` method was added to stop the heartbeat ticker when it is no longer needed. Signed-off-by: SammyOina <[email protected]>
The commit fixes error handling in agent/config.go by adding more specific error variables and updating the error messages. This improves the clarity and readability of the codebase. Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
Refactor build workflow The build22.yml file has been deleted. This commit removes the build22.yml file, which was used to create and publish a Docker image. The file is no longer needed as it is no longer being used in the project. Signed-off-by: SammyOina <[email protected]>
This commit adds a new test for the PushOperation function in the edgex package. The test creates a mock HTTP server and checks the HTTP request method, URL, and request body. The test ensures that the function correctly handles the POST request with the expected URL and request body. Signed-off-by: SammyOina <[email protected]>
This commit adds tests for the conn package. The tests cover various scenarios and ensure the functionality of the package is working as expected. Signed-off-by: SammyOina <[email protected]>
The commit fixes a bug in the client_test.go file where the expected response was not being properly set. The bug caused the test to fail. The fix ensures that the expected response is correctly set and the test passes as expected. Signed-off-by: SammyOina <[email protected]>
The commit fixes error handling in main.go and endpoints_test.go. It ensures that the server is properly shutdown and logs any errors that occur during the shutdown process. Signed-off-by: SammyOina <[email protected]>
rodneyosodo
requested changes
Sep 28, 2023
Signed-off-by: SammyOina <[email protected]>
The Docker image tag and file path in the Makefile and Dockerfile have been fixed to use the correct repository name "Mainflux" instead of "sammyoina". This ensures that the Docker images are tagged and pushed to the correct repository. Additionally, the file path in the Dockerfile has been updated to correctly move the built executable to the desired location. Signed-off-by: SammyOina <[email protected]>
Signed-off-by: SammyOina <[email protected]>
The Docker image tag in the Makefile was updated to use lowercase "mainflux" instead of "Mainflux". This ensures consistency with the naming convention used for the Docker images. Signed-off-by: SammyOina <[email protected]>
rodneyosodo
previously approved these changes
Sep 28, 2023
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.
LGTM
dborovcanin
requested changes
Sep 29, 2023
Signed-off-by: SammyOina <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this do?
Adds tests to agent
Which issue(s) does this PR fix/relate to?
Resolves #22
List any changes that modify/break current functionality
Have you included tests for your changes?
Did you document any new/modified functionality?
Notes