Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Make additional config validation tests more resilient #37594

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

evan-bradley
Copy link
Contributor

Description

Follow up to #37579. This should address issues with the remaining tests.

@@ -84,7 +84,7 @@ func TestConfigValidateMissingAuth(t *testing.T) {
cfg := createDefaultConfig().(*Config)
cfg.Queue = "someQueue"
err := component.ValidateConfig(cfg)
assert.Equal(t, errMissingAuthDetails, err)
assert.ErrorContains(t, err, errMissingAuthDetails.Error())
Copy link
Member

Choose a reason for hiding this comment

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

Why not "ErrorIs"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The motivation for these changes is open-telemetry/opentelemetry-collector#12108, which prints the path in the config that produced this error. I don't want to depend on the format of the error message produced by component.ValidateConfig, only the part of the error produced by this component.

Copy link
Contributor

@pjanotti pjanotti left a comment

Choose a reason for hiding this comment

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

windowspercountersreceiver LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants