-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[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.
I am going to merge the PR to unblock the work on core, since this are tests if you want to change it after the PR is merged we can do that
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
…telemetry#37594) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Follow up to open-telemetry#37579. This should address issues with the remaining tests.
Description
Follow up to #37579. This should address issues with the remaining tests.