forked from jaegertracing/jaeger
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[grpc-storage] Use grpc.NewClient (jaegertracing#5393)
## Which problem is this PR solving? - Part of jaegertracing#5330 ## Description of the changes - use grpc.NewClient - add extra test ## How was this change tested? - CI --------- Signed-off-by: Yuri Shkuro <github@ysh.us>
- Loading branch information
1 parent
7d32d36
commit 299d942
Showing
3 changed files
with
33 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) 2024 The Jaeger Authors. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package config | ||
|
||
import ( | ||
"errors" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
"go.uber.org/zap" | ||
"google.golang.org/grpc" | ||
) | ||
|
||
func TestBuildRemoteNewClientError(t *testing.T) { | ||
// this is a silly test to verify handling of error from grpc.NewClient, which cannot be induced via params. | ||
c := &Configuration{} | ||
_, err := c.buildRemote(zap.NewNop(), nil, func(target string, opts ...grpc.DialOption) (conn *grpc.ClientConn, err error) { | ||
return nil, errors.New("test error") | ||
}) | ||
require.Error(t, err) | ||
require.Contains(t, err.Error(), "error creating remote storage client") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters