From c0b8478f459511a96eb0d6dc1209a450cbc033a4 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 12 Dec 2022 11:40:40 -0800 Subject: [PATCH] Remove deprecated componenttest.NewNop*CreateSettings Signed-off-by: Bogdan Drutu --- .chloggen/rmdepnopset.yaml | 11 +++++++++++ component/componenttest/nop_exporter.go | 8 -------- component/componenttest/nop_extension.go | 8 -------- component/componenttest/nop_receiver.go | 8 -------- exporter/exportertest/nop_exporter.go | 9 ++++++++- extension/extensiontest/nop_extension.go | 9 ++++++++- receiver/receivertest/nop_receiver.go | 13 +++++++++++-- 7 files changed, 38 insertions(+), 28 deletions(-) create mode 100755 .chloggen/rmdepnopset.yaml diff --git a/.chloggen/rmdepnopset.yaml b/.chloggen/rmdepnopset.yaml new file mode 100755 index 00000000000..0edec7d251c --- /dev/null +++ b/.chloggen/rmdepnopset.yaml @@ -0,0 +1,11 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: componenttest + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove deprecated componenttest.NewNop*CreateSettings + +# One or more tracking issues or pull requests related to the change +issues: [6761] diff --git a/component/componenttest/nop_exporter.go b/component/componenttest/nop_exporter.go index f1fcb49b78e..e81a6327bca 100644 --- a/component/componenttest/nop_exporter.go +++ b/component/componenttest/nop_exporter.go @@ -22,14 +22,6 @@ import ( "go.opentelemetry.io/collector/exporter" ) -// Deprecated: [v0.67.0] use exportertest.NewNopCreateSettings. -func NewNopExporterCreateSettings() exporter.CreateSettings { - return exporter.CreateSettings{ - TelemetrySettings: NewNopTelemetrySettings(), - BuildInfo: component.NewDefaultBuildInfo(), - } -} - // Deprecated: [v0.67.0] use exportertest.NewNopFactory. func NewNopExporterFactory() exporter.Factory { return exporter.NewFactory( diff --git a/component/componenttest/nop_extension.go b/component/componenttest/nop_extension.go index 5866d66947e..928a2c9b677 100644 --- a/component/componenttest/nop_extension.go +++ b/component/componenttest/nop_extension.go @@ -21,14 +21,6 @@ import ( "go.opentelemetry.io/collector/extension" ) -// Deprecated: [v0.67.0] use extensiontest.NewNopCreateSettings. -func NewNopExtensionCreateSettings() extension.CreateSettings { - return extension.CreateSettings{ - TelemetrySettings: NewNopTelemetrySettings(), - BuildInfo: component.NewDefaultBuildInfo(), - } -} - // Deprecated: [v0.67.0] use extensiontest.NewNopFactory. func NewNopExtensionFactory() extension.Factory { return extension.NewFactory( diff --git a/component/componenttest/nop_receiver.go b/component/componenttest/nop_receiver.go index e1479a05a0e..bee1ab274d1 100644 --- a/component/componenttest/nop_receiver.go +++ b/component/componenttest/nop_receiver.go @@ -22,14 +22,6 @@ import ( "go.opentelemetry.io/collector/receiver" ) -// Deprecated: [v0.67.0] use receivertest.NewNopCreateSettings. -func NewNopReceiverCreateSettings() receiver.CreateSettings { - return receiver.CreateSettings{ - TelemetrySettings: NewNopTelemetrySettings(), - BuildInfo: component.NewDefaultBuildInfo(), - } -} - // Deprecated: [v0.67.0] use receivertest.NewNopFactory func NewNopReceiverFactory() receiver.Factory { return receiver.NewFactory( diff --git a/exporter/exportertest/nop_exporter.go b/exporter/exportertest/nop_exporter.go index 2be0e2be340..c1c9fc1e3a1 100644 --- a/exporter/exportertest/nop_exporter.go +++ b/exporter/exportertest/nop_exporter.go @@ -15,11 +15,18 @@ package exportertest // import "go.opentelemetry.io/collector/exporter/exportertest" import ( + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/exporter" ) // NewNopCreateSettings returns a new nop settings for Create*Exporter functions. -var NewNopCreateSettings = componenttest.NewNopExporterCreateSettings //nolint:staticcheck +func NewNopCreateSettings() exporter.CreateSettings { + return exporter.CreateSettings{ + TelemetrySettings: componenttest.NewNopTelemetrySettings(), + BuildInfo: component.NewDefaultBuildInfo(), + } +} // NewNopFactory returns an exporter.Factory that constructs nop exporters. var NewNopFactory = componenttest.NewNopExporterFactory //nolint:staticcheck diff --git a/extension/extensiontest/nop_extension.go b/extension/extensiontest/nop_extension.go index 676f828a69b..5275ae532e4 100644 --- a/extension/extensiontest/nop_extension.go +++ b/extension/extensiontest/nop_extension.go @@ -15,11 +15,18 @@ package extensiontest // import "go.opentelemetry.io/collector/extension/extensiontest" import ( + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/extension" ) // NewNopCreateSettings returns a new nop settings for extension.Factory Create* functions. -var NewNopCreateSettings = componenttest.NewNopExtensionCreateSettings //nolint:staticcheck +func NewNopCreateSettings() extension.CreateSettings { + return extension.CreateSettings{ + TelemetrySettings: componenttest.NewNopTelemetrySettings(), + BuildInfo: component.NewDefaultBuildInfo(), + } +} // NewNopFactory returns an extension.Factory that constructs nop extensions. var NewNopFactory = componenttest.NewNopExtensionFactory //nolint:staticcheck diff --git a/receiver/receivertest/nop_receiver.go b/receiver/receivertest/nop_receiver.go index 5cd86115dff..f1f275843b2 100644 --- a/receiver/receivertest/nop_receiver.go +++ b/receiver/receivertest/nop_receiver.go @@ -14,10 +14,19 @@ package receivertest // import "go.opentelemetry.io/collector/receiver/receivertest" -import "go.opentelemetry.io/collector/component/componenttest" +import ( + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/receiver" +) // NewNopCreateSettings returns a new nop settings for Create* functions. -var NewNopCreateSettings = componenttest.NewNopReceiverCreateSettings //nolint:staticcheck +func NewNopCreateSettings() receiver.CreateSettings { + return receiver.CreateSettings{ + TelemetrySettings: componenttest.NewNopTelemetrySettings(), + BuildInfo: component.NewDefaultBuildInfo(), + } +} // NewNopFactory returns a receiver.Factory that constructs nop receivers. var NewNopFactory = componenttest.NewNopReceiverFactory //nolint:staticcheck