-
Notifications
You must be signed in to change notification settings - Fork 19
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
Could this gem support client_interceptors? #25
Comments
Could you explain the use case? This gem is used for mocking gRPC responses in tests, but I’m not sure why interceptors are needed." |
Hi @ganmacs . In my project, I need to persist all gRPC API request/response in database.
The idea is wrap some logic in the API transaction lifecycle, similar to a rack middleware. In rspec and cucumber tests, I want to confirm the log was persisted. If I use That's why I would like this gem to support client interceptors, so that I don't have to write a walk around solution like mock a real grpc server in a thread. I created a PR to contribute this feature #26 |
GrpcMock gem works great, only one thing concerned us is in our system, we use
client_interceptors
and track log as events.GrpcMock only mock the request response but skipped interceptors.
https://github.com/ganmacs/grpc_mock/blob/master/lib/grpc_mock/grpc_stub_adapter.rb#L22
and https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/generic/client_stub.rb#L173
After compared above code, I can see it misses
interception_context.intercept!(:request_response, intercept_args)
Is there a plan to support
interecept
for this gem? Thank you!The text was updated successfully, but these errors were encountered: