@@ -77,7 +77,10 @@ func TestDefaultExporters(t *testing.T) {
77
77
{
78
78
exporter : "awscloudwatchlogs" ,
79
79
getConfigFn : func () component.Config {
80
- return expFactories ["awscloudwatchlogs" ].CreateDefaultConfig ()
80
+ cfg := expFactories ["awscloudwatchlogs" ].CreateDefaultConfig ().(* awscloudwatchlogsexporter.Config )
81
+ cfg .Endpoint = "http://" + endpoint
82
+ cfg .Region = "local"
83
+ return cfg
81
84
},
82
85
skipLifecycle : true ,
83
86
},
@@ -210,15 +213,6 @@ func TestDefaultExporters(t *testing.T) {
210
213
return cfg
211
214
},
212
215
},
213
- {
214
- exporter : "awscloudwatch" ,
215
- getConfigFn : func () component.Config {
216
- cfg := expFactories ["awscloudwatch" ].CreateDefaultConfig ().(* awscloudwatchlogsexporter.Config )
217
- cfg .Endpoint = "http://" + endpoint
218
- cfg .Region = "local"
219
- return cfg
220
- },
221
- },
222
216
{
223
217
exporter : "awsemf" ,
224
218
getConfigFn : func () component.Config {
@@ -454,20 +448,8 @@ func TestDefaultExporters(t *testing.T) {
454
448
},
455
449
}
456
450
457
- exporterCount := 0
458
- expectedExporters := map [component.Type ]struct {}{}
459
- for k := range expFactories {
460
- expectedExporters [k ] = struct {}{}
461
- }
451
+ assert .Equal (t , len (expFactories ), len (tests ), "All user configurable components must be added to the lifecycle test" )
462
452
for _ , tt := range tests {
463
- _ , ok := expFactories [tt .exporter ]
464
- if ! ok {
465
- // not part of the distro, skipping.
466
- continue
467
- }
468
- tt := tt
469
- exporterCount ++
470
- delete (expectedExporters , tt .exporter )
471
453
t .Run (string (tt .exporter ), func (t * testing.T ) {
472
454
factory := expFactories [tt .exporter ]
473
455
assert .Equal (t , tt .exporter , factory .Type ())
@@ -482,7 +464,6 @@ func TestDefaultExporters(t *testing.T) {
482
464
})
483
465
})
484
466
}
485
- assert .Len (t , expFactories , exporterCount , "All user configurable components must be added to the lifecycle test" , expectedExporters )
486
467
}
487
468
488
469
// GetExporterConfigFn is used customize the configuration passed to the verification.
0 commit comments