From 3ecf9bc8d0d85e47c87f7b2e1d9fc2b40eb8507c Mon Sep 17 00:00:00 2001 From: Evan Bradley <11745660+evan-bradley@users.noreply.github.com> Date: Wed, 6 Aug 2025 10:56:34 -0400 Subject: [PATCH 1/2] [componenttest] Remove `GetFactory` from nopHost --- .../componenttest-remove-getfactory.yaml | 25 +++++++++++++++++++ component/componenttest/nop_host.go | 6 ++--- 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 .chloggen/componenttest-remove-getfactory.yaml diff --git a/.chloggen/componenttest-remove-getfactory.yaml b/.chloggen/componenttest-remove-getfactory.yaml new file mode 100644 index 000000000000..cedd99df45a1 --- /dev/null +++ b/.chloggen/componenttest-remove-getfactory.yaml @@ -0,0 +1,25 @@ +# Use this changelog template to create an entry for release notes. + +# 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 `GetFactory` from the host returned by `NewNopHost` + +# One or more tracking issues or pull requests related to the change +issues: [] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: This method is no longer part of the `component.Host` interface. + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [api] diff --git a/component/componenttest/nop_host.go b/component/componenttest/nop_host.go index 3c9206456a38..3c6bba5a2580 100644 --- a/component/componenttest/nop_host.go +++ b/component/componenttest/nop_host.go @@ -7,6 +7,8 @@ import ( "go.opentelemetry.io/collector/component" ) +var _ component.Host = (*nopHost)(nil) + // nopHost mocks a receiver.ReceiverHost for test purposes. type nopHost struct{} @@ -15,10 +17,6 @@ func NewNopHost() component.Host { return &nopHost{} } -func (nh *nopHost) GetFactory(component.Kind, component.Type) component.Factory { - return nil -} - func (nh *nopHost) GetExtensions() map[component.ID]component.Component { return nil } From e893a67378c32474a56f0907d1b660ff9dacee5e Mon Sep 17 00:00:00 2001 From: Evan Bradley <11745660+evan-bradley@users.noreply.github.com> Date: Wed, 6 Aug 2025 11:21:47 -0400 Subject: [PATCH 2/2] Add issue number to changelog --- .chloggen/componenttest-remove-getfactory.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.chloggen/componenttest-remove-getfactory.yaml b/.chloggen/componenttest-remove-getfactory.yaml index cedd99df45a1..f72b60465b9e 100644 --- a/.chloggen/componenttest-remove-getfactory.yaml +++ b/.chloggen/componenttest-remove-getfactory.yaml @@ -10,7 +10,7 @@ component: componenttest note: Remove `GetFactory` from the host returned by `NewNopHost` # One or more tracking issues or pull requests related to the change -issues: [] +issues: [13577] # (Optional) One or more lines of additional information to render under the primary note. # These lines will be padded with 2 spaces and then inserted directly into the document.