Skip to content

Commit

Permalink
Modify config factory test to used MusteNewID
Browse files Browse the repository at this point in the history
  • Loading branch information
vasireddy99 committed Apr 26, 2024
1 parent 7bd56ea commit c983588
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
10 changes: 1 addition & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/aws-observability/aws-otel-collector

go 1.21.0

toolchain go1.21.4
go 1.21

require (
github.com/open-telemetry/opentelemetry-collector-contrib/confmap/provider/s3provider v0.98.0
Expand Down Expand Up @@ -441,10 +439,4 @@ exclude github.com/DataDog/agent-payload/v5 v5.0.59 // indirect
// openshift removed all tags from their repo, use the pseudoversion from the release-3.9 branch HEAD
replace github.com/openshift/api v3.9.0+incompatible => github.com/openshift/api v0.0.0-20180801171038-322a19404e37

replace github.com/cyphar/filepath-securejoin v0.2.3 => github.com/cyphar/filepath-securejoin v0.2.4

replace github.com/sirupsen/logrus v1.9.0 => github.com/sirupsen/logrus v1.9.3

replace github.com/opencontainers/runc v1.1.9 => github.com/opencontainers/runc v1.1.12

replace github.com/google/cadvisor v0.49.1 => github.com/google/cadvisor v0.49.0
10 changes: 5 additions & 5 deletions pkg/config/config_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestGetCfgFactoryConfig(t *testing.T) {
cfg, err := provider.Get(context.Background(), factories)
require.NoError(t, err)
require.NotNil(t, cfg)
receiver := cfg.Receivers[component.NewID("awsxray")].(*awsxrayreceiver.Config)
receiver := cfg.Receivers[component.MustNewID("awsxray")].(*awsxrayreceiver.Config)
require.NotNil(t, receiver)
require.Equal(t, expectedEndpoint, receiver.Endpoint)
})
Expand All @@ -101,7 +101,7 @@ func TestGetCfgFactoryConfig(t *testing.T) {
cfg, err := provider.Get(context.Background(), factories)
require.NoError(t, err)
require.NotNil(t, cfg)
receiver := cfg.Receivers[component.NewID("awsxray")].(*awsxrayreceiver.Config)
receiver := cfg.Receivers[component.MustNewID("awsxray")].(*awsxrayreceiver.Config)
require.NotNil(t, receiver)
require.Empty(t, receiver.Endpoint)
})
Expand All @@ -118,10 +118,10 @@ func TestGetMapProviderContainer(t *testing.T) {
cfg, err := provider.Get(context.Background(), factories)
require.NoError(t, err)
require.NotNil(t, cfg)
extension := cfg.Extensions[component.NewID("pprof")].(*pprofextension.Config)
extension := cfg.Extensions[component.MustNewID("pprof")].(*pprofextension.Config)
require.NotNil(t, extension)
require.Equal(t, expectedEndpoint, extension.TCPAddr.Endpoint)

require.NotNil(t, cfg.Receivers[component.NewID("otlp")])
require.NotNil(t, cfg.Exporters[component.NewID("awsemf")])
require.NotNil(t, cfg.Receivers[component.MustNewID("otlp")])
require.NotNil(t, cfg.Exporters[component.MustNewID("awsemf")])
}
4 changes: 1 addition & 3 deletions testbed/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/aws-observability/aws-otel-collector/testbed

go 1.21.0

toolchain go1.21.4
go 1.21

require (
github.com/aws-observability/aws-otel-collector v0.38.1
Expand Down

0 comments on commit c983588

Please sign in to comment.