Skip to content

Commit

Permalink
Added emptycall to stubserver
Browse files Browse the repository at this point in the history
  • Loading branch information
pvsravani committed Dec 19, 2024
1 parent 2899311 commit a2ae0e4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
10 changes: 8 additions & 2 deletions test/creds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,10 @@ func (s) TestCredsHandshakeAuthority(t *testing.T) {
cred := &authorityCheckCreds{}
stub := &stubserver.StubServer{

Check failure on line 435 in test/creds_test.go

View workflow job for this annotation

GitHub Actions / tests (vet, 1.22)

parameter 'ctx' seems to be unused, consider removing or renaming it as _ https://revive.run/r#unused-parameter

Check failure on line 435 in test/creds_test.go

View workflow job for this annotation

GitHub Actions / tests (vet, 1.22)

parameter 'in' seems to be unused, consider removing or renaming it as _ https://revive.run/r#unused-parameter
Listener: lis,
S: grpc.NewServer(),
EmptyCallF: func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) {
return &testpb.Empty{}, nil
},
S: grpc.NewServer(),
}
stubserver.StartTestService(t, stub)
defer stub.S.Stop()
Expand Down Expand Up @@ -469,7 +472,10 @@ func (s) TestCredsHandshakeServerNameAuthority(t *testing.T) {

stub := &stubserver.StubServer{
Listener: lis,

Check failure on line 474 in test/creds_test.go

View workflow job for this annotation

GitHub Actions / tests (vet, 1.22)

parameter 'ctx' seems to be unused, consider removing or renaming it as _ https://revive.run/r#unused-parameter

Check failure on line 474 in test/creds_test.go

View workflow job for this annotation

GitHub Actions / tests (vet, 1.22)

parameter 'in' seems to be unused, consider removing or renaming it as _ https://revive.run/r#unused-parameter
S: grpc.NewServer(),
EmptyCallF: func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) {
return &testpb.Empty{}, nil
},
S: grpc.NewServer(),
}
stubserver.StartTestService(t, stub)
defer stub.S.Stop()
Expand Down
5 changes: 4 additions & 1 deletion test/goaway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,10 @@ func (s) TestTwoGoAwayPingFrames(t *testing.T) {
defer lis.Close()
ss := &stubserver.StubServer{
Listener: lis,
S: grpc.NewServer(),
EmptyCallF: func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) {

Check failure on line 737 in test/goaway_test.go

View workflow job for this annotation

GitHub Actions / tests (vet, 1.22)

parameter 'ctx' seems to be unused, consider removing or renaming it as _ https://revive.run/r#unused-parameter

Check failure on line 737 in test/goaway_test.go

View workflow job for this annotation

GitHub Actions / tests (vet, 1.22)

parameter 'in' seems to be unused, consider removing or renaming it as _ https://revive.run/r#unused-parameter
return &testpb.Empty{}, nil
},
S: grpc.NewServer(),
}
stubserver.StartTestService(t, ss)
defer ss.S.Stop()
Expand Down
10 changes: 8 additions & 2 deletions test/healthcheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ func setupServer(t *testing.T, watchFunc healthWatchFunc) (*grpc.Server, net.Lis

stub := &stubserver.StubServer{
Listener: lis,
S: grpc.NewServer(),
EmptyCallF: func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) {
return &testpb.Empty{}, nil
},
S: grpc.NewServer(),
}
healthgrpc.RegisterHealthServer(stub.S, ts)
stubserver.StartTestService(t, stub)
Expand Down Expand Up @@ -260,7 +263,10 @@ func (s) TestHealthCheckHealthServerNotRegistered(t *testing.T) {
}
stub := &stubserver.StubServer{
Listener: lis,
S: grpc.NewServer(),
EmptyCallF: func(ctx context.Context, in *testpb.Empty) (*testpb.Empty, error) {
return &testpb.Empty{}, nil
},
S: grpc.NewServer(),
}
defer stub.S.Stop()

Expand Down

0 comments on commit a2ae0e4

Please sign in to comment.