-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Libbeat] Add more complete tests for opt parameters in ES output #18393
Conversation
This PR add additionnal test over the usager of the `parameters` options in the Elasticsearch output: - When preconfigured params are set without local params - When preconfigured params are set with local params - When no preconfigured params are configured but local are. - When no preconfigured or local params are set. The merge is also done close to the actual calls and will not be executed if anything fails before the bulk request. The test assertion is now more solid and take into consideration any errors. See discussion in #18318 and #18326
Pinging @elastic/ingest-management (Team:Ingest Management) |
💚 Build SucceededExpand to view the summary
Build stats
Test stats 🧪
Steps errorsExpand to view the steps failures
|
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.
LGTM
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.
LGTM. We should also backport these to 7.x to make sure we don't break things there.
|
||
for k, v := range test.expected { | ||
assert.Equal(t, recParams.Get(k), v) | ||
} |
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.
assert.Equal(t, test.expected, recParams)
should actually work.
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 url.Values
is a map[string][]string
, which I find a bit weird, where every accessor only deals with key/value.. :
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.
Does it make sense to add another check that recParams
does not include additional fields not found in test.exptected
?
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.
We already do that by comparing the len
of the map, so the len
all items need to match.
https://github.com/elastic/beats/pull/18393/files#diff-7bf553dedc14bb868bc139267101d16cR248
…8393) (#18491) * [Libbeat] Add more complete tests for opt parameters in ES output This PR add additionnal test over the usager of the `parameters` options in the Elasticsearch output: - When preconfigured params are set without local params - When preconfigured params are set with local params - When no preconfigured params are configured but local are. - When no preconfigured or local params are set. The merge is also done close to the actual calls and will not be executed if anything fails before the bulk request. The test assertion is now more solid and take into consideration any errors. See discussion in #18318 and #18326 (cherry picked from commit 9c8bbaa)
…8393) (#18492) * [Libbeat] Add more complete tests for opt parameters in ES output This PR add additionnal test over the usager of the `parameters` options in the Elasticsearch output: - When preconfigured params are set without local params - When preconfigured params are set with local params - When no preconfigured params are configured but local are. - When no preconfigured or local params are set. The merge is also done close to the actual calls and will not be executed if anything fails before the bulk request. The test assertion is now more solid and take into consideration any errors. See discussion in #18318 and #18326 (cherry picked from commit 9c8bbaa)
This PR add additionnal test over the usager of the
parameters
optionsin the Elasticsearch output:
The merge is also done close to the actual calls and will not be
executed if anything fails before the bulk request.
The test assertion is now more solid and take into consideration any
errors.
See discussion in #18318 and #18326
What does this PR do?
Why is it important?
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs