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

authz: modify the tests to use stubserver instead of testservice implementations #7888

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

janardhanvissa
Copy link
Contributor

Partially Addresses: #7291

RELEASE NOTES: None

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 81.94%. Comparing base (e8055ea) to head (4298e86).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
internal/stubserver/stubserver.go 50.00% 2 Missing ⚠️
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     
Files with missing lines Coverage Δ
internal/stubserver/stubserver.go 80.00% <50.00%> (-0.92%) ⬇️

... and 23 files with indirect coverage changes

@purnesh42H purnesh42H modified the milestones: 1.69 Release, 1.70 Release Dec 5, 2024
Copy link
Contributor

@purnesh42H purnesh42H left a 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!

authz/audit/audit_logging_test.go Show resolved Hide resolved
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
Copy link
Contributor

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

FullDuplexCallF: func(stream testgrpc.TestService_FullDuplexCallServer) error {
?

Copy link
Contributor

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

@purnesh42H purnesh42H changed the title stubserver: Initializing StreamingInputCall and StreamingOutputCall in the stubserver authz: Modify the tests to use stubserver instead of testservice implementations Dec 6, 2024
@purnesh42H purnesh42H changed the title authz: Modify the tests to use stubserver instead of testservice implementations authz: modify the tests to use stubserver instead of testservice implementations Dec 6, 2024
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
Copy link
Contributor

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

@janardhanvissa janardhanvissa force-pushed the stubserver-streamingcall branch from cfba48c to ecdab23 Compare December 20, 2024 09:56
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
Copy link
Contributor

@purnesh42H purnesh42H Dec 21, 2024

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

Copy link
Contributor

@purnesh42H purnesh42H left a 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

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants