From 7f271591ffd27643e40f09a5adffb21c6846461c Mon Sep 17 00:00:00 2001 From: dmathieu <42@dmathieu.com> Date: Mon, 26 Aug 2024 11:27:28 +0200 Subject: [PATCH] test profiles in nop processor --- processor/processortest/nop_processor_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/processor/processortest/nop_processor_test.go b/processor/processortest/nop_processor_test.go index 41a52893d15..3ffdb7feed8 100644 --- a/processor/processortest/nop_processor_test.go +++ b/processor/processortest/nop_processor_test.go @@ -16,6 +16,7 @@ import ( "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/pprofile" "go.opentelemetry.io/collector/pdata/ptrace" ) @@ -46,6 +47,13 @@ func TestNewNopFactory(t *testing.T) { assert.NoError(t, logs.Start(context.Background(), componenttest.NewNopHost())) assert.NoError(t, logs.ConsumeLogs(context.Background(), plog.NewLogs())) assert.NoError(t, logs.Shutdown(context.Background())) + + profiles, err := factory.CreateProfilesProcessor(context.Background(), NewNopSettings(), cfg, consumertest.NewNop()) + require.NoError(t, err) + assert.Equal(t, consumer.Capabilities{MutatesData: false}, profiles.Capabilities()) + assert.NoError(t, profiles.Start(context.Background(), componenttest.NewNopHost())) + assert.NoError(t, profiles.ConsumeProfiles(context.Background(), pprofile.NewProfiles())) + assert.NoError(t, profiles.Shutdown(context.Background())) } func TestNewNopBuilder(t *testing.T) {