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

chore(deps): bump the all group with 4 updates #647

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cloudclient/dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func DialService(ctx context.Context, target string, opts ...grpc.DialOption) (*
PermitWithoutStream: true,
}),
}
conn, err := grpc.DialContext(ctx, withDefaultPort(target, 443), append(defaultOpts, opts...)...)
conn, err := grpc.NewClient(withDefaultPort(target, 443), append(defaultOpts, opts...)...)
if err != nil {
return nil, fmt.Errorf("dial %s: %w", target, err)
}
Expand Down
2 changes: 1 addition & 1 deletion cloudclient/dialinsecure.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func DialServiceInsecure(ctx context.Context, target string, opts ...grpc.DialOp
grpc.WithPerRPCCredentials(insecureTokenSource{TokenSource: idTokenSource}),
grpc.WithTransportCredentials(insecure.NewCredentials()),
}
conn, err := grpc.DialContext(ctx, parsedTarget.Host, append(defaultOpts, opts...)...)
conn, err := grpc.NewClient(parsedTarget.Host, append(defaultOpts, opts...)...)
if err != nil {
return nil, fmt.Errorf("dial insecure '%s': %w", target, err)
}
Expand Down
2 changes: 1 addition & 1 deletion cloudmux/mux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (fx *testFixture) listen() {

func greeterClient(t *testing.T, addr net.Addr) helloworld.GreeterClient {
t.Helper()
conn, err := grpc.Dial(
conn, err := grpc.NewClient(
addr.String(),
grpc.WithBlock(),
grpc.WithTransportCredentials(insecure.NewCredentials()),
Expand Down
19 changes: 9 additions & 10 deletions cloudserver/middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func bufDialer(lis *bufconn.Listener) func(context.Context, string) (net.Conn, e

func TestGRPCUnary_ContextTimeoutWithDeadlineExceededErr(t *testing.T) {
ctx := context.Background()
server, client := grpcSetup(ctx, t)
server, client := grpcSetup(t)
server.deadlineExceeeded = true

_, err := client.Ping(ctx, &testproto.PingRequest{})
Expand All @@ -78,7 +78,7 @@ func TestGRPCUnary_ContextTimeoutWithDeadlineExceededErr(t *testing.T) {

func TestGRPCUnary_RescuePanicsWithStatusInternalError(t *testing.T) {
ctx := context.Background()
server, client := grpcSetup(ctx, t)
server, client := grpcSetup(t)
server.panicOnRequest = true

_, err := client.Ping(ctx, &testproto.PingRequest{})
Expand All @@ -87,7 +87,7 @@ func TestGRPCUnary_RescuePanicsWithStatusInternalError(t *testing.T) {

func TestGRPCStream_ContextTimeoutWithDeadlineExceededErr(t *testing.T) {
ctx := context.Background()
server, client := grpcSetup(ctx, t)
server, client := grpcSetup(t)
server.deadlineExceeeded = true

stream, err := client.PingStream(ctx)
Expand All @@ -98,7 +98,7 @@ func TestGRPCStream_ContextTimeoutWithDeadlineExceededErr(t *testing.T) {

func TestGRPCStream_RescuePanicsWithStatusInternalError(t *testing.T) {
ctx := context.Background()
server, client := grpcSetup(ctx, t)
server, client := grpcSetup(t)
server.panicOnRequest = true

stream, err := client.PingStream(ctx)
Expand All @@ -110,15 +110,15 @@ func TestGRPCStream_RescuePanicsWithStatusInternalError(t *testing.T) {

func TestGRPCUnary_NoRequestError(t *testing.T) {
ctx := context.Background()
_, client := grpcSetup(ctx, t)
_, client := grpcSetup(t)

_, err := client.Ping(ctx, &testproto.PingRequest{})
assert.NilError(t, err)
}

func TestGRPCStream_NoRequestError(t *testing.T) {
ctx := context.Background()
_, client := grpcSetup(ctx, t)
_, client := grpcSetup(t)

stream, err := client.PingStream(ctx)
assert.NilError(t, err) // while it looks strange, this is setting up the stream
Expand All @@ -129,7 +129,7 @@ func TestGRPCStream_NoRequestError(t *testing.T) {
assert.Error(t, err, "EOF")
}

func grpcSetup(ctx context.Context, t *testing.T) (*Server, testproto.TestServiceClient) {
func grpcSetup(t *testing.T) (*Server, testproto.TestServiceClient) {
lis := bufconn.Listen(bufSize)
middleware := cloudserver.Middleware{Config: cloudserver.Config{Timeout: time.Second * 5}}
server := grpc.NewServer(
Expand All @@ -143,9 +143,8 @@ func grpcSetup(ctx context.Context, t *testing.T) (*Server, testproto.TestServic
log.Fatalf("Server exited with error: %v", err)
}
}()
conn, err := grpc.DialContext(
ctx,
"bufnet",
conn, err := grpc.NewClient(
"passthrough://bufnet",
grpc.WithContextDialer(bufDialer(lis)),
grpc.WithTransportCredentials(insecure.NewCredentials()),
)
Expand Down