-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
base: main
Are you sure you want to change the base?
[chore] Make additional config validation tests more resilient #37594
Conversation
receiver/hostmetricsreceiver/internal/scraper/filesystemscraper/filesystem_scraper_test.go
Outdated
Show resolved
Hide resolved
@@ -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()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not "ErrorIs"?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
windowspercountersreceiver
LGTM
Description
Follow up to #37579. This should address issues with the remaining tests.