Skip to content

Commit

Permalink
Fix Unit Tests
Browse files Browse the repository at this point in the history
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
  • Loading branch information
mahadzaryab1 committed Nov 12, 2024
1 parent d502ad1 commit 9eb152e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugin/storage/grpc/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func makeMockServices() *ClientPluginServices {
func makeFactory(t *testing.T) *Factory {
f := NewFactory()
f.InitFromViper(viper.New(), zap.NewNop())
f.config.ClientConfig.Endpoint = "http://test.com"
require.NoError(t, f.Initialize(metrics.NullFactory, zap.NewNop()))

t.Cleanup(func() {
Expand Down Expand Up @@ -120,7 +121,11 @@ func TestNewFactoryError(t *testing.T) {

t.Run("client", func(t *testing.T) {
// this is a silly test to verify handling of error from grpc.NewClient, which cannot be induced via params.
f, err := NewFactoryWithConfig(Config{}, metrics.NullFactory, zap.NewNop(), componenttest.NewNopHost())
f, err := NewFactoryWithConfig(Config{
ClientConfig: configgrpc.ClientConfig{
Endpoint: "http://test.com",
},
}, metrics.NullFactory, zap.NewNop(), componenttest.NewNopHost())
require.NoError(t, err)
t.Cleanup(func() { require.NoError(t, f.Close()) })
newClientFn := func(_ component.TelemetrySettings, _ ...grpc.DialOption) (conn *grpc.ClientConn, err error) {
Expand Down

0 comments on commit 9eb152e

Please sign in to comment.