Include human readable responses in response parsing tests#22717
Merged
cbuescher merged 2 commits intoelastic:masterfrom Jan 24, 2017
Merged
Include human readable responses in response parsing tests#22717cbuescher merged 2 commits intoelastic:masterfrom
cbuescher merged 2 commits intoelastic:masterfrom
Conversation
As a follow up to elastic#22649, this changes the resent tests for parsing parts of search responses to randomly set the humanReadable() flag of the XContentBuilder that is used to render the responses. This should help to test that we can parse back thoses classes if the user specifies `?human=true` in the request url.
Member
Author
|
No, all good, I think the human flag only makes a difference in the Profile section output at the moment. These tests are mostly added to protect us from suprises in the future. |
tlrx
approved these changes
Jan 20, 2017
| String id = randomAsciiOfLength(5); | ||
| long seqNo = randomIntBetween(-2, 5); | ||
| long version = (long) randomIntBetween(0, 5); | ||
| long seqNo = randomBoolean() ? randomNonNegativeLong() : randomIntBetween(0, 10000); |
Member
There was a problem hiding this comment.
Can we use
randomFrom(SequenceNumbersService.UNASSIGNED_SEQ_NO, randomNonNegativeLong(), randomIntBetween(0, 10000))
instead?
| String id = randomAsciiOfLength(5); | ||
| long seqNo = randomIntBetween(-2, 5); | ||
| long version = (long) randomIntBetween(0, 5); | ||
| long seqNo = randomBoolean() ? randomNonNegativeLong() : randomIntBetween(0, 10000); |
cbuescher
added a commit
that referenced
this pull request
Jan 24, 2017
As a follow up to #22649, this changes the resent tests for parsing parts of search responses to randomly set the humanReadable() flag of the XContentBuilder that is used to render the responses. This should help to test that we can parse back thoses classes if the user specifies `?human=true` in the request url.
Member
Author
|
Added to 5.x with 25a219f |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As a follow up to #22649, this changes the resent tests for parsing parts of search responses to randomly set the humanReadable() flag of
the XContentBuilder that is used to render the responses. This should help to test that we can parse back thoses classes if the user specifies
?human=truein the request url.