Skip to content

Commit

Permalink
Adding all the processors to the list to be tested (#8369)
Browse files Browse the repository at this point in the history
Ensure that processors are tested by defautl to avoid pontetial
lifecycle issues being released.
  • Loading branch information
MovieStoreGuy authored Mar 11, 2022
1 parent cd3f30c commit c119771
Showing 1 changed file with 44 additions and 3 deletions.
47 changes: 44 additions & 3 deletions internal/components/processors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ func TestDefaultProcessors(t *testing.T) {
procFactories := allFactories.Processors

tests := []struct {
processor config.Type
getConfigFn getProcessorConfigFn
processor config.Type
getConfigFn getProcessorConfigFn
skipLifecycle bool
}{
{
processor: "attributes",
Expand All @@ -58,9 +59,22 @@ func TestDefaultProcessors(t *testing.T) {
{
processor: "batch",
},
{
processor: "deltatorate",
},
{
processor: "filter",
},
{
processor: "groupbyattrs",
},
{
processor: "groupbytrace",
},
{
processor: "k8sattributes",
skipLifecycle: true, // Requires a k8s API to communicate with
},
{
processor: "memory_limiter",
getConfigFn: func() config.Processor {
Expand All @@ -70,9 +84,18 @@ func TestDefaultProcessors(t *testing.T) {
return cfg
},
},
{
processor: "metricstransform",
},
{
processor: "experimental_metricsgeneration",
},
{
processor: "probabilistic_sampler",
},
{
processor: "resourcedetection",
},
{
processor: "resource",
getConfigFn: func() config.Processor {
Expand All @@ -83,6 +106,10 @@ func TestDefaultProcessors(t *testing.T) {
return cfg
},
},
{
processor: "routing",
skipLifecycle: true, // Requires external exporters to be configured to route data
},
{
processor: "span",
getConfigFn: func() config.Processor {
Expand All @@ -91,16 +118,30 @@ func TestDefaultProcessors(t *testing.T) {
return cfg
},
},
{
processor: "spanmetrics",
skipLifecycle: true, // Requires a running exporter to convert data to/from
},
{
processor: "cumulativetodelta",
},
{
processor: "tail_sampling",
},
}

assert.Equal(t, len(tests)+11 /* not tested */, len(procFactories))
assert.Len(t, tests, len(procFactories), "All processors MUST be added to lifecycle tests")
for _, tt := range tests {
t.Run(string(tt.processor), func(t *testing.T) {
factory, ok := procFactories[tt.processor]
require.True(t, ok)
assert.Equal(t, tt.processor, factory.Type())
assert.EqualValues(t, config.NewComponentID(tt.processor), factory.CreateDefaultConfig().ID())

if tt.skipLifecycle {
t.Skip("Skipping lifecycle processor check for:", tt.processor)
return
}
verifyProcessorLifecycle(t, factory, tt.getConfigFn)
})
}
Expand Down

0 comments on commit c119771

Please sign in to comment.