-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
authz: modify the tests to use stubserver instead of testservice implementations #7888
base: master
Are you sure you want to change the base?
authz: modify the tests to use stubserver instead of testservice implementations #7888
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7888 +/- ##
==========================================
- Coverage 82.08% 81.94% -0.15%
==========================================
Files 379 379
Lines 38261 38265 +4
==========================================
- Hits 31406 31355 -51
- Misses 5551 5595 +44
- Partials 1304 1315 +11
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 comment otherwise lgtm. Good work!
internal/stubserver/stubserver.go
Outdated
EmptyCallF func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) | ||
UnaryCallF func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) | ||
FullDuplexCallF func(stream testgrpc.TestService_FullDuplexCallServer) error | ||
StreamingInputCallF func(stream testgrpc.TestService_StreamingInputCallServer) error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janardhanvissa i think we don't need to create extra functions for input and output. Can you just use the FullDuplexCallF for streaming calls
grpc-go/authz/audit/audit_logging_test.go
Line 250 in 66ba4b2
FullDuplexCallF: func(stream testgrpc.TestService_FullDuplexCallServer) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline. We need to use stream.CloseAndRecv() so we need a client streaming handler. We should rename it to ClientStreamingInputCall and ClientStreamingOutputCall though
internal/stubserver/stubserver.go
Outdated
UnaryCallF func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) | ||
FullDuplexCallF func(stream testgrpc.TestService_FullDuplexCallServer) error | ||
ClientStreamingInputCall func(stream testgrpc.TestService_StreamingInputCallServer) error | ||
ClientStreamingOutputCall func(req *testpb.StreamingOutputCallRequest, stream testgrpc.TestService_StreamingOutputCallServer) error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janardhanvissa let's change this StreamingInputCall and StreamingOutputCall and in the comment mention that that input is for ClientStreaming and output is for ServerStreaming
cfba48c
to
ecdab23
Compare
…to stubserver-streamingcall
internal/stubserver/stubserver.go
Outdated
EmptyCallF func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) | ||
UnaryCallF func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) | ||
FullDuplexCallF func(stream testgrpc.TestService_FullDuplexCallServer) error | ||
StreamingInputCallF func(stream testgrpc.TestService_StreamingInputCallServer) error // ClientStreaming |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next to StreamingInputCallF
please mention Client-Streaming request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. Please address the comment suggestion for Streaming calls
internal/stubserver/stubserver.go
Outdated
UnaryCallF func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) | ||
FullDuplexCallF func(stream testgrpc.TestService_FullDuplexCallServer) error | ||
StreamingInputCallF func(stream testgrpc.TestService_StreamingInputCallServer) error // ClientStreaming | ||
StreamingOutputCallF func(req *testpb.StreamingOutputCallRequest, stream testgrpc.TestService_StreamingOutputCallServer) error // ServerStreaming |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next to StreamingOutputCallF
please mention Server-streaming response
Partially Addresses: #7291
RELEASE NOTES: None