Skip to content

Commit

Permalink
remove tests
Browse files Browse the repository at this point in the history
Signed-off-by: ChrsMark <[email protected]>
  • Loading branch information
ChrsMark committed Dec 17, 2024
1 parent d939620 commit e403420
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 92 deletions.
52 changes: 0 additions & 52 deletions config/configgrpc/configgrpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
"go.uber.org/zap/zaptest/observer"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
Expand Down Expand Up @@ -514,56 +512,6 @@ func TestUseSecure(t *testing.T) {
assert.Len(t, dialOpts, 2)
}

func TestGRPCServerWarning(t *testing.T) {
tests := []struct {
name string
settings ServerConfig
len int
}{
{
settings: ServerConfig{
NetAddr: confignet.AddrConfig{
Endpoint: "0.0.0.0:1234",
Transport: confignet.TransportTypeTCP,
},
},
len: 1,
},
{
settings: ServerConfig{
NetAddr: confignet.AddrConfig{
Endpoint: "127.0.0.1:1234",
Transport: confignet.TransportTypeTCP,
},
},
len: 0,
},
{
settings: ServerConfig{
NetAddr: confignet.AddrConfig{
Endpoint: "0.0.0.0:1234",
Transport: confignet.TransportTypeUnix,
},
},
len: 0,
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
set := componenttest.NewNopTelemetrySettings()
logger, observed := observer.New(zap.DebugLevel)
set.Logger = zap.New(logger)

opts, err := test.settings.getGrpcServerOptions(componenttest.NewNopHost(), set, []ToServerOption{})
require.NoError(t, err)
require.NotNil(t, opts)
_ = grpc.NewServer(opts...)

require.Len(t, observed.FilterLevelExact(zap.WarnLevel).All(), test.len)
})
}
}

func TestGRPCServerSettingsError(t *testing.T) {
tests := []struct {
settings ServerConfig
Expand Down
40 changes: 0 additions & 40 deletions config/confighttp/confighttp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap"
"go.uber.org/zap/zaptest/observer"

"go.opentelemetry.io/collector/client"
"go.opentelemetry.io/collector/component"
Expand Down Expand Up @@ -516,45 +515,6 @@ func TestHTTPServerSettingsError(t *testing.T) {
}
}

func TestHTTPServerWarning(t *testing.T) {
tests := []struct {
name string
settings ServerConfig
len int
}{
{
settings: ServerConfig{
Endpoint: "0.0.0.0:0",
},
len: 1,
},
{
settings: ServerConfig{
Endpoint: "127.0.0.1:0",
},
len: 0,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
set := componenttest.NewNopTelemetrySettings()
logger, observed := observer.New(zap.DebugLevel)
set.Logger = zap.New(logger)

_, err := tt.settings.ToServer(
context.Background(),
componenttest.NewNopHost(),
set,
http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
_, errWrite := fmt.Fprint(w, "tt")
assert.NoError(t, errWrite)
}))
require.NoError(t, err)
require.Len(t, observed.FilterLevelExact(zap.WarnLevel).All(), tt.len)
})
}
}

func TestHttpReception(t *testing.T) {
tests := []struct {
name string
Expand Down

0 comments on commit e403420

Please sign in to comment.