-
Notifications
You must be signed in to change notification settings - Fork 254
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
cmd/peer: Refactor and test processing of response #499
Conversation
Some insight: Initially I wanted to treat the In favour of simplicity and readability, I instead took this approach. This refactors and tests the functional aspects of processing an event, rather than its setup. |
While not trivial, it's probably simpler than you think. We actually have a fake peer client in the Cilium tree. It is actually used for Hubble Relay's pool manager unit tests. |
Thanks for that insight @rolinh – I unknowingly did venture into that route on my own before charting on the current way but I will re-visit it once again. The pool manager unit tests look very interesting in their approach. Definitely something to learn from. I'll time box and take a stab at it. There's definitely value in testing |
So I tried to use the I tried to validate the above by doing the following, which seems to work:
I believe In the interest of slicing thin, do you think we should keep adding tests for |
Signed-off-by: Simarpreet Singh <simar@linux.com>
Actually, this is not the issue at play here. We suffer from a problem with the grpc dependency which broke version compatibility and this affects a cilium dependency (etcd). We managed to use a recent grpc version in this repository because so far, nothing we pulled from cilium pulled the etcd dependency. It seems that pulling in the
More information about this problem here. We're currently pending on a new release of the etcd dependency which should fix this problem.
As I can't tell when the above issue will be resolved, I think your proposal is reasonable. |
Oh I see. I'll subscribe to that PR in that case to keep track. |
This PR refactors a small piece of processing code and adds tests.
Signed-off-by: Simarpreet Singh simar@linux.com