magistrala
magistrala copied to clipboard
MF-1197 - MQTT tests
What does this do?
Added MQTT unit tests
Which issue(s) does this PR fix/relate to?
Resolves #1197
List any changes that modify/break current functionality
Have you included tests for your changes?
MQTT unit tests
Did you document any new/modified functionality?
No
Notes
Codecov Report
Merging #1622 (4c510b5) into master (78b025c) will increase coverage by
0.10%. The diff coverage is85.18%.
@@ Coverage Diff @@
## master #1622 +/- ##
==========================================
+ Coverage 68.91% 69.01% +0.10%
==========================================
Files 143 145 +2
Lines 11544 11671 +127
==========================================
+ Hits 7955 8055 +100
- Misses 2888 2911 +23
- Partials 701 705 +4
| Impacted Files | Coverage Δ | |
|---|---|---|
| mqtt/handler.go | 92.45% <85.18%> (ø) |
|
| mqtt/forwarder.go | 0.00% <0.00%> (ø) |
|
| things/service.go | 66.07% <0.00%> (+0.71%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Merged! Thanks @zzokki81. This was a nice solution with log analysis, but we should improve in the future by adding return values to the handlers.
The main improvement would be adding return errors where it's missing, and using pubsub mocks to check if pubsub methods are called for successful flow (rather than checking for info logs). Also, moving the logger from the handler implementation to the logging wrapper/middleware is a good idea.
Issue to track: https://github.com/mainflux/mproxy/issues/31