Skip to content
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

new: unit tests for PubSubClient NATS implementation Subscribe method #54

Merged
merged 1 commit into from May 22, 2019

Conversation

Projects
None yet
2 participants
@aaslamin
Copy link
Contributor

commented May 22, 2019

This PR adds unit test coverage for the Subscribe method by bringing up a real NATS server on loopback interface as per suggested by the upstream NATS Go client maintainer here. This is actually how the upstream Go NATS client tests their implementation.

Scenarios covered:

  • should successfully subscribe to topic and receive a publication in provided channel
  • should NOT receive anything in publication channel that cannot be decoded into a publication
  • should respond back with an ACK message to all publications that expect an ACK response
  • should be able to set a custom response using the NATSOptSubscribeReplyer option to all publications that expect a response

@aaslamin aaslamin requested review from primalmotion and t00f May 22, 2019

@aaslamin

This comment has been minimized.

Copy link
Contributor Author

commented May 22, 2019

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "",
    "component": "bahamut",
    "pr-id": "54",
    "commit-sha": "4adead2f0585bb803708f9b494e3b15495896e80"
  }
]
@primalmotion
Copy link
Member

left a comment

works nice

@codecov

This comment has been minimized.

Copy link

commented May 22, 2019

Codecov Report

Merging #54 into master will increase coverage by 0.9%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #54     +/-   ##
=========================================
+ Coverage   87.23%   88.13%   +0.9%     
=========================================
  Files          28       28             
  Lines        2107     2107             
=========================================
+ Hits         1838     1857     +19     
+ Misses        244      222     -22     
- Partials       25       28      +3
Impacted Files Coverage Δ
pubsub_nats.go 45% <0%> (+19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a04690d...4adead2. Read the comment docs.

@aaslamin

This comment has been minimized.

Copy link
Contributor Author

commented May 22, 2019

/build - automatically fired by gogo with following PRs and commit SHAs v1.0.0

[
  {
    "project": "",
    "component": "bahamut",
    "pr-id": "54",
    "commit-sha": "4adead2f0585bb803708f9b494e3b15495896e80"
  }
]

@aaslamin aaslamin merged commit 79bdbe1 into master May 22, 2019

4 checks passed

built
Details
codecov/patch Coverage not affected when comparing a04690d...4adead2
Details
codecov/project 88.13% (+0.9%) compared to a04690d
Details
unit-tests
Details

@aaslamin aaslamin deleted the subscribe-pubsub-unit-tests branch May 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.