Skip to content

Commit

Permalink
fixup! [chore] Change receiver config tests to unmarshal config only …
Browse files Browse the repository at this point in the history
…for that component.
  • Loading branch information
kovrus committed Aug 17, 2022
1 parent 41ed084 commit e78e8fe
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions receiver/activedirectorydsreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ import (
func TestLoadConfig(t *testing.T) {
t.Parallel()

cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
require.NoError(t, err)

defaultMetricsSettings := metadata.DefaultMetricsSettings()
defaultMetricsSettings.ActiveDirectoryDsReplicationObjectRate.Enabled = false
tests := []struct {
Expand All @@ -55,9 +58,6 @@ func TestLoadConfig(t *testing.T) {

for _, tt := range tests {
t.Run(tt.id.String(), func(t *testing.T) {
cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
require.NoError(t, err)

factory := NewFactory()
cfg := factory.CreateDefaultConfig()

Expand Down
6 changes: 3 additions & 3 deletions receiver/awscontainerinsightreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import (
func TestLoadConfig(t *testing.T) {
t.Parallel()

cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
require.NoError(t, err)

tests := []struct {
id config.ComponentID
expected config.Receiver
Expand All @@ -51,9 +54,6 @@ func TestLoadConfig(t *testing.T) {

for _, tt := range tests {
t.Run(tt.id.String(), func(t *testing.T) {
cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
require.NoError(t, err)

factory := NewFactory()
cfg := factory.CreateDefaultConfig()

Expand Down
6 changes: 3 additions & 3 deletions receiver/awsecscontainermetricsreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ import (
func TestLoadConfig(t *testing.T) {
t.Parallel()

cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
require.NoError(t, err)

tests := []struct {
id config.ComponentID
expected config.Receiver
Expand All @@ -47,9 +50,6 @@ func TestLoadConfig(t *testing.T) {

for _, tt := range tests {
t.Run(tt.id.String(), func(t *testing.T) {
cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
require.NoError(t, err)

factory := NewFactory()
cfg := factory.CreateDefaultConfig()

Expand Down
6 changes: 3 additions & 3 deletions receiver/awsxrayreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ import (
func TestLoadConfig(t *testing.T) {
t.Parallel()

cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
require.NoError(t, err)

tests := []struct {
id config.ComponentID
expected config.Receiver
Expand Down Expand Up @@ -90,9 +93,6 @@ func TestLoadConfig(t *testing.T) {

for _, tt := range tests {
t.Run(tt.id.String(), func(t *testing.T) {
cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
require.NoError(t, err)

factory := NewFactory()
cfg := factory.CreateDefaultConfig()

Expand Down
6 changes: 3 additions & 3 deletions receiver/carbonreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ import (
func TestLoadConfig(t *testing.T) {
t.Parallel()

cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
require.NoError(t, err)

tests := []struct {
id config.ComponentID
expected config.Receiver
Expand Down Expand Up @@ -89,9 +92,6 @@ func TestLoadConfig(t *testing.T) {

for _, tt := range tests {
t.Run(tt.id.String(), func(t *testing.T) {
cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
require.NoError(t, err)

factory := NewFactory()
cfg := factory.CreateDefaultConfig()

Expand Down
6 changes: 3 additions & 3 deletions receiver/cloudfoundryreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ import (
func TestLoadConfig(t *testing.T) {
t.Parallel()

cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
require.NoError(t, err)

tests := []struct {
id config.ComponentID
expected config.Receiver
Expand Down Expand Up @@ -73,9 +76,6 @@ func TestLoadConfig(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.id.String(), func(t *testing.T) {
cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
require.NoError(t, err)

factory := NewFactory()
cfg := factory.CreateDefaultConfig()

Expand Down
6 changes: 3 additions & 3 deletions receiver/elasticsearchreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ func TestValidateEndpoint(t *testing.T) {
func TestLoadConfig(t *testing.T) {
t.Parallel()

cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
require.NoError(t, err)

defaultMetrics := metadata.DefaultMetricsSettings()
defaultMetrics.ElasticsearchNodeFsDiskAvailable.Enabled = false
tests := []struct {
Expand Down Expand Up @@ -182,9 +185,6 @@ func TestLoadConfig(t *testing.T) {

for _, tt := range tests {
t.Run(tt.id.String(), func(t *testing.T) {
cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml"))
require.NoError(t, err)

factory := NewFactory()
cfg := factory.CreateDefaultConfig()

Expand Down

0 comments on commit e78e8fe

Please sign in to comment.