-
Notifications
You must be signed in to change notification settings - Fork 5.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
Fix lustre2 input plugin config parse regression #6114
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7a188a5
Add failing test for lustre2 input toml parsing regression
GeorgeMac 50d5bad
Fix config parsing regression in lustre2 input
GeorgeMac 01f2d55
Replace assert with require in lustre2 input plugin test
GeorgeMac 539d768
Add explicit toml struct tags to lustre2 input plugin config
GeorgeMac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Just an observation. I have mixed feelings on this test, you could imagine having tests like this for all plugins and overall I think if we did this it would be too burdensome in it's current form. On the other hand obviously it does check for a valid bug.
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 agree that in this form it would be burdensome. I actually had mentioned about having a test like this everywhere with @goller.
Would a kind of test harness for all plugins be worthwhile?
e.g.
Which would validate the plugin has been registered under
some_plugin
. Parse the result ofplugin.SamplePlugin()
and assert it against the providedtelegraf.Input
.Could have one per plugin type and capture some high-level criteria like this.
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 guess I'm ambivalent, it's not something that has historically been a huge source of bugs, so it might just not be worth the effort or a situation where we have bigger fish to fry. We could definitely provide a better interface to the config package to ease toml string -> plugin, but I'm not entirely sure how the harness would work. It seems like you need to provide at a minimum the input TOML with all options set, and a filled plugin struct to compare against.
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.
Yeah my illustration is lacking a little. For this PR shall I just leave it as is or remove the test?
The harness would ideally test all configurable fields, so the sample would need uncommenting in part if it were used. This could be done with a simple regexp, but that may be brittle and difficult to explain.