@@ -34,20 +34,20 @@ func TestDecodeConfig(t *testing.T) {
3434 assert .NoError (t , err )
3535
3636 // Load the config
37- config , err := loadConfigFile (t , path .Join ("." , "testdata" , "valid-config.yaml" ), factories )
37+ cfg , err := loadConfigFile (t , path .Join ("." , "testdata" , "valid-config.yaml" ), factories )
3838 require .NoError (t , err , "Unable to load config" )
3939
4040 // Verify extensions.
41- assert .Equal (t , 3 , len (config .Extensions ))
42- assert .Equal (t , "some string" , config .Extensions ["exampleextension/1" ].(* testcomponents.ExampleExtensionCfg ).ExtraSetting )
41+ assert .Equal (t , 3 , len (cfg .Extensions ))
42+ assert .Equal (t , "some string" , cfg .Extensions ["exampleextension/1" ].(* testcomponents.ExampleExtensionCfg ).ExtraSetting )
4343
4444 // Verify service.
45- assert .Equal (t , 2 , len (config .Service .Extensions ))
46- assert .Equal (t , "exampleextension/0" , config .Service .Extensions [0 ])
47- assert .Equal (t , "exampleextension/1" , config .Service .Extensions [1 ])
45+ assert .Equal (t , 2 , len (cfg .Service .Extensions ))
46+ assert .Equal (t , "exampleextension/0" , cfg .Service .Extensions [0 ])
47+ assert .Equal (t , "exampleextension/1" , cfg .Service .Extensions [1 ])
4848
4949 // Verify receivers
50- assert .Equal (t , 2 , len (config .Receivers ), "Incorrect receivers count" )
50+ assert .Equal (t , 2 , len (cfg .Receivers ), "Incorrect receivers count" )
5151
5252 assert .Equal (t ,
5353 & testcomponents.ExampleReceiver {
@@ -60,7 +60,7 @@ func TestDecodeConfig(t *testing.T) {
6060 },
6161 ExtraSetting : "some string" ,
6262 },
63- config .Receivers ["examplereceiver" ],
63+ cfg .Receivers ["examplereceiver" ],
6464 "Did not load receiver config correctly" )
6565
6666 assert .Equal (t ,
@@ -74,11 +74,11 @@ func TestDecodeConfig(t *testing.T) {
7474 },
7575 ExtraSetting : "some string" ,
7676 },
77- config .Receivers ["examplereceiver/myreceiver" ],
77+ cfg .Receivers ["examplereceiver/myreceiver" ],
7878 "Did not load receiver config correctly" )
7979
8080 // Verify exporters
81- assert .Equal (t , 2 , len (config .Exporters ), "Incorrect exporters count" )
81+ assert .Equal (t , 2 , len (cfg .Exporters ), "Incorrect exporters count" )
8282
8383 assert .Equal (t ,
8484 & testcomponents.ExampleExporter {
@@ -88,7 +88,7 @@ func TestDecodeConfig(t *testing.T) {
8888 },
8989 ExtraSetting : "some export string" ,
9090 },
91- config .Exporters ["exampleexporter" ],
91+ cfg .Exporters ["exampleexporter" ],
9292 "Did not load exporter config correctly" )
9393
9494 assert .Equal (t ,
@@ -99,11 +99,11 @@ func TestDecodeConfig(t *testing.T) {
9999 },
100100 ExtraSetting : "some export string 2" ,
101101 },
102- config .Exporters ["exampleexporter/myexporter" ],
102+ cfg .Exporters ["exampleexporter/myexporter" ],
103103 "Did not load exporter config correctly" )
104104
105105 // Verify Processors
106- assert .Equal (t , 1 , len (config .Processors ), "Incorrect processors count" )
106+ assert .Equal (t , 1 , len (cfg .Processors ), "Incorrect processors count" )
107107
108108 assert .Equal (t ,
109109 & testcomponents.ExampleProcessorCfg {
@@ -113,11 +113,11 @@ func TestDecodeConfig(t *testing.T) {
113113 },
114114 ExtraSetting : "some export string" ,
115115 },
116- config .Processors ["exampleprocessor" ],
116+ cfg .Processors ["exampleprocessor" ],
117117 "Did not load processor config correctly" )
118118
119119 // Verify Pipelines
120- assert .Equal (t , 1 , len (config .Service .Pipelines ), "Incorrect pipelines count" )
120+ assert .Equal (t , 1 , len (cfg .Service .Pipelines ), "Incorrect pipelines count" )
121121
122122 assert .Equal (t ,
123123 & configmodels.Pipeline {
@@ -127,7 +127,7 @@ func TestDecodeConfig(t *testing.T) {
127127 Processors : []string {"exampleprocessor" },
128128 Exporters : []string {"exampleexporter" },
129129 },
130- config .Service .Pipelines ["traces" ],
130+ cfg .Service .Pipelines ["traces" ],
131131 "Did not load pipeline config correctly" )
132132}
133133
0 commit comments