From c119771581f0d5103fbffd2d576247f0050dfd57 Mon Sep 17 00:00:00 2001 From: Sean Marciniak <30928402+MovieStoreGuy@users.noreply.github.com> Date: Sat, 12 Mar 2022 04:33:55 +1030 Subject: [PATCH] Adding all the processors to the list to be tested (#8369) Ensure that processors are tested by defautl to avoid pontetial lifecycle issues being released. --- internal/components/processors_test.go | 47 ++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/internal/components/processors_test.go b/internal/components/processors_test.go index f26b70855397..a86c9f1ef978 100644 --- a/internal/components/processors_test.go +++ b/internal/components/processors_test.go @@ -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", @@ -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 { @@ -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 { @@ -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 { @@ -91,9 +118,19 @@ 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] @@ -101,6 +138,10 @@ func TestDefaultProcessors(t *testing.T) { 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) }) }