From ee728f70e403a4f3347a30be5fc2944ab17ce8e4 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Thu, 22 Feb 2024 09:13:24 -0800 Subject: [PATCH] [chore] remove errnextnilconsumer tests (#31304) **Description:** We are looking to deprecate component.ErrNilNextConsumer and have pipelines check it rather than set it the expectation on every component that the next component may be nil. See https://github.com/open-telemetry/opentelemetry-collector/pull/9526 for context. --- .../splunkenterprisereceiver/factory_test.go | 17 ----------------- receiver/webhookeventreceiver/factory_test.go | 18 ------------------ receiver/webhookeventreceiver/receiver_test.go | 5 ----- 3 files changed, 40 deletions(-) diff --git a/receiver/splunkenterprisereceiver/factory_test.go b/receiver/splunkenterprisereceiver/factory_test.go index 17031d573961..244bcc5980f4 100644 --- a/receiver/splunkenterprisereceiver/factory_test.go +++ b/receiver/splunkenterprisereceiver/factory_test.go @@ -66,23 +66,6 @@ func TestCreateMetricsReceiver(t *testing.T) { require.NoError(t, err, "failed to create metrics receiver with valid inputs") }, }, - { - desc: "Missing consumer", - run: func(t *testing.T) { - t.Parallel() - - cfg := createDefaultConfig().(*Config) - - _, err := createMetricsReceiver( - context.Background(), - receivertest.NewNopCreateSettings(), - cfg, - nil, - ) - - require.Error(t, err, "created metrics receiver without consumer") - }, - }, } for _, test := range tests { t.Run(test.desc, test.run) diff --git a/receiver/webhookeventreceiver/factory_test.go b/receiver/webhookeventreceiver/factory_test.go index b42bf564a91d..d7ee4b3cd163 100644 --- a/receiver/webhookeventreceiver/factory_test.go +++ b/receiver/webhookeventreceiver/factory_test.go @@ -47,24 +47,6 @@ func TestCreateLogsReceiver(t *testing.T) { require.NoError(t, err, "failed to create logs receiver") }, }, - { - desc: "Missing consumer", - run: func(t *testing.T) { - t.Parallel() - - cfg := createDefaultConfig().(*Config) - cfg.Endpoint = "localhost:8080" - require.NoError(t, cfg.Validate(), "error validating default config") - - _, err := createLogsReceiver( - context.Background(), - receivertest.NewNopCreateSettings(), - cfg, - nil, - ) - require.Error(t, err, "Succeeded in creating a receiver without a consumer") - }, - }, } for _, test := range tests { diff --git a/receiver/webhookeventreceiver/receiver_test.go b/receiver/webhookeventreceiver/receiver_test.go index be712a853c8e..fce622a74b5e 100644 --- a/receiver/webhookeventreceiver/receiver_test.go +++ b/receiver/webhookeventreceiver/receiver_test.go @@ -55,11 +55,6 @@ func TestCreateNewLogReceiver(t *testing.T) { }, consumer: consumertest.NewNop(), }, - { - desc: "Missing consumer fails", - cfg: *defaultConfig, - err: errNilLogsConsumer, - }, } for _, test := range tests {