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: add test coverage for scenario: should receive an error in errors channel if subscribing fails for any reason #55

Merged
merged 1 commit into from May 24, 2019

Conversation

Projects
None yet
2 participants
@aaslamin
Copy link
Contributor

commented May 22, 2019

This test covers the behaviour where Subscribe fails due to an error - https://github.com/aporeto-inc/bahamut/blob/master/pubsub_nats.go#L131

Notice what this implies for the consumer of this API, they must either:

  • pass in a buffered error channel
  • start reading from the error channel prior to calling Subscribe

Otherwise if they hit this error condition, they would be blocked forever as writing to an unbuffered channel will indefinitely block unless there is a reader on the other side...

new: add test coverage for scenario: should receive an error in error…
…s channel if subscribing fails for any reason

Signed-off-by: Amir Aslaminejad <amir.a@aporeto.com>

@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": "55",
    "commit-sha": "f3f9a45e5cfd2d41be3e73c11afffed0f1cb7574"
  }
]
@codecov

This comment has been minimized.

Copy link

commented May 22, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #55      +/-   ##
==========================================
+ Coverage   88.13%   88.27%   +0.14%     
==========================================
  Files          28       28              
  Lines        2107     2107              
==========================================
+ Hits         1857     1860       +3     
+ Misses        222      220       -2     
+ Partials       28       27       -1
Impacted Files Coverage Δ
pubsub_nats.go 48% <0%> (+3%) ⬆️

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 79bdbe1...f3f9a45. Read the comment docs.

@primalmotion primalmotion merged commit 59d7918 into master May 24, 2019

6 checks passed

built
Details
codecov/patch Coverage not affected when comparing 79bdbe1...f3f9a45
Details
codecov/project 88.27% (+0.14%) compared to 79bdbe1
Details
functional-tests Submitter: reason: . functional-tests set to success
Details
functional-tests-trigger Submitter: reason: . functional-tests-trigger set to success
Details
unit-tests
Details

@primalmotion primalmotion deleted the unit-test-cover-subscribe-error branch May 24, 2019

@aaslamin

This comment has been minimized.

Copy link
Contributor Author

commented May 29, 2019

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

[
  {
    "project": "",
    "component": "bahamut",
    "pr-id": "55",
    "commit-sha": "f3f9a45e5cfd2d41be3e73c11afffed0f1cb7574"
  },
  {
    "project": "",
    "component": "backend",
    "pr-id": "408",
    "commit-sha": "6f3c24caaae0e91a09c4257d22a410299978dccd"
  }
]
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.