Skip to content

Conversation

@evan-bradley
Copy link
Contributor

Description

The GetFactory method was moved from component.Host to hostcapabilities.ComponentFactory. From what I can tell, this method is not used on the no-op host anywhere in core, and introduces an implicit loop in the dependency graph, so we should remove it before componenttest is made stable.

Link to tracking issue

Works toward #13490

@evan-bradley evan-bradley requested a review from a team as a code owner August 6, 2025 15:00
@evan-bradley evan-bradley requested a review from songy23 August 6, 2025 15:00
@codecov
Copy link

codecov bot commented Aug 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.24%. Comparing base (1c8a5c4) to head (f0f2f88).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13577      +/-   ##
==========================================
- Coverage   92.24%   92.24%   -0.01%     
==========================================
  Files         614      614              
  Lines       33686    33684       -2     
==========================================
- Hits        31075    31071       -4     
- Misses       2076     2077       +1     
- Partials      535      536       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evan-bradley
Copy link
Contributor Author

I've been looking into that, unfortunately it's more complicated than just fixing up a test: it's a generated test, so either we have to disable lifecycle tests on the receivercreator, create a servicetest package that mdatagen uses that offers a service with all hostcapabilities interfaces implemented (or some combination of them), or some third option.

Right now I'm leaning toward disabling the generated tests and writing more comprehensive tests to validate the receiver's startup behavior. The receiver is unique enough that I think it warrants having its own tests.

@bogdandrutu
Copy link
Member

@evan-bradley I think we should change mdatagen to call with a host that implements the hostcapabilities.ComponentFactory as well. What do you think about doing that first?

@evan-bradley
Copy link
Contributor Author

@bogdandrutu that's okay with me. I've implemented it here: #13589.

I think that unless we provide options to generate a test matrix for whether calls to Start are successful for a given host and the interfaces it implements, it will come down to the component to write its own lifecycle tests for its own behavior. For example, components that want hostcapabilities.ComponentFactory should probably error out if the host doesn't implement that interface, but some components that use hostcapabilities.ModuleInfo will simply emit a log.

github-merge-queue bot pushed a commit that referenced this pull request Aug 8, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Use a custom noop host implementation that implements all
non-deprecated, publicly-accessible interfaces implemented by the
Collector service.

I didn't implement the `ExposeExporters` interface since it is
deprecated.

Related to
#13577.
@bogdandrutu bogdandrutu added this pull request to the merge queue Aug 9, 2025
Merged via the queue into open-telemetry:main with commit 185f7dd Aug 9, 2025
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants