[chore] Make config validation tests more resilient #37579
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes some errors introduced by open-telemetry/opentelemetry-collector#12108.
Overall this makes tests that check errors resulting from config validation more resilient by only checking that the error message contains the information relevant to the component. The tests changed in this PR make more precise assumptions about the error message that no longer hold up if
component.ValidateConfig
returns errors with different internal structures or messages.I've run this locally with the changes in open-telemetry/opentelemetry-collector#12108, but I encountered some issues that prevented running tests locally in some modules, so not all errors may be fixed. I will play more with this tomorrow, but I also think it's safe to merge this as-is and fix the remaining errors during a
make update-otel
PR.