<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add `component.Type` parameter to `NewNopSettings` And deprecate
`NewNopSettingsWithType` cc @mx-psi
<!-- Issue number if applicable -->
#### Link to tracking issue
Relevant to #12305
<!--Describe what testing was performed and which tests were added.-->
#### Testing
Updated
<!--Describe the documentation added.-->
#### Documentation
Added
<!--Please delete paragraphs that you did not use before submitting.-->
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
<!-- Issue number if applicable -->
Creates `NewNopSettingsWithType` function on test modules and deprecates
the `NewNopSettings` functions on those modules. Replace all usages of
`NewNopSettings` with `NewNopSettingsWithType`.
Part of #12305 but applied to all component kinds.
#### Link to tracking issue
Updates #12221
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Explicitly error out if the passed `component.ID` does not have a
matching `component.Type`
<!-- Issue number if applicable -->
#### Link to tracking issue
Updates #12221
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
update other lifecycle generated tests to not be impacted by
fieldalignment
<!-- Issue number if applicable -->
#### Link to tracking issue
See #12121 for original PR.
This deprecates CreateSettings in favour of Settings.
NewNopCreateSettings is also being deprecated in favour of
NewNopSettings
Part of #9428
---------
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
**Description:**
This PR removes the top level if/else in `component.UnmarshalConfig`,
handling recursive state in the confmap.Conf object instead.
This PR deprecates `component.UnmarshalConfig` in favor of calling
directly `Unmarshal` on the confmap.Conf object.
**Link to tracking Issue:**
Fixes#7102Fixes#7101
---------
Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com>
The tests generated by cmd/builder are skipped in contrib because they
cause the CI timeouts. We moved the lifecycle tests to the tests
generated by mdatagen, but the config/factory smoke tests are still part
of the files generated by cmd/builder.
Recently, the loadbalancing exporter got an invalid camelCase config
field because of this coverage gap.
This change moves the config/factory tests from cmd/builder to
cmd/mdatagen. So, they are always generated for every component, even if
not used in any collector bundle.
**Description:**
fix#9688
The batchprocessor use a `batchProcessor` as a common struct which
implements `consumer.Traces`, `consumer.Metrics`, `consumer.Logs` in the
meantime.
As a result, the generated lifecycle test will fail, since when it
create a metrics, traces processor object, it will still fall to the
case `consumer.Logs` and panic.
```
=== RUN TestComponentLifecycle/metrics-shutdown
=== RUN TestComponentLifecycle/metrics-lifecycle
panic: interface conversion: interface {} is plog.Logs, not pmetric.Metrics
goroutine 37 [running]:
go.opentelemetry.io/collector/processor/batchprocessor.(*batchMetrics).add(0x14000208120?, {0x10572aae0?, 0x1400029c3f0?})
/Users/zhaoziqi/Documents/go/src/go.opentelemetry.io/opentelemetry-collector/processor/batchprocessor/batch_processor.go:450 +0x208
go.opentelemetry.io/collector/processor/batchprocessor.(*shard).processItem(0x14000292200, {0x10572aae0?, 0x1400029c3f0?})
/Users/zhaoziqi/Documents/go/src/go.opentelemetry.io/opentelemetry-collector/processor/batchprocessor/batch_processor.go:226 +0x38
go.opentelemetry.io/collector/processor/batchprocessor.(*shard).start(0x14000292200)
/Users/zhaoziqi/Documents/go/src/go.opentelemetry.io/opentelemetry-collector/processor/batchprocessor/batch_processor.go:199 +0x1a0
created by go.opentelemetry.io/collector/processor/batchprocessor.(*batchProcessor).newShard in goroutine 36
/Users/zhaoziqi/Documents/go/src/go.opentelemetry.io/opentelemetry-collector/processor/batchprocessor/batch_processor.go:160 +0x1a4
exit status 2
FAIL go.opentelemetry.io/collector/processor/batchprocessor 0.594s
```
**Link to tracking Issue:** <Issue number if applicable>
fix#9688
---------
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
This change is required in preparation of #9750
This removes the call to `component.UnmarshalConfig` in preparation of
its deprecation, and instead has the `Conf` object unmarshal itself into
the `Config` struct.