Make some agg tests easier to read#54954
Merged
nik9000 merged 1 commit intoelastic:masterfrom Apr 10, 2020
Merged
Conversation
We added a fancy method to provide random realistic test data to the reduction tests in elastic#54910. This uses that to remove some of the more esoteric machinations in the agg tests. This will marginally increase the coverage of the serialiation tests and, more importantly, remove some mysterious value generation code that only really made sense for random reduction tests but was used all over the place. It doesn't, on the other hand, make the tests shorter. Just *hopefully* more clear. I only cleaned up a few tests this way. If we like this it'd probably be worth grabbing others.
Collaborator
|
Pinging @elastic/es-analytics-geo (:Analytics/Aggregations) |
imotov
approved these changes
Apr 10, 2020
Contributor
imotov
left a comment
There was a problem hiding this comment.
Oh, that's a nice refactoring. I was a bit concerned that we were overdoing it, but I now can clearly see that his abstraction was indeed really needed there. Thanks!
Member
Author
I opened 3 random tests. All three needed it. |
nik9000
added a commit
to nik9000/elasticsearch
that referenced
this pull request
Apr 10, 2020
We added a fancy method to provide random realistic test data to the reduction tests in elastic#54910. This uses that to remove some of the more esoteric machinations in the agg tests. This will marginally increase the coverage of the serialiation tests and, more importantly, remove some mysterious value generation code that only really made sense for random reduction tests but was used all over the place. It doesn't, on the other hand, make the tests shorter. Just *hopefully* more clear. I only cleaned up a few tests this way. If we like this it'd probably be worth grabbing others.
nik9000
added a commit
that referenced
this pull request
Apr 10, 2020
We added a fancy method to provide random realistic test data to the reduction tests in #54910. This uses that to remove some of the more esoteric machinations in the agg tests. This will marginally increase the coverage of the serialiation tests and, more importantly, remove some mysterious value generation code that only really made sense for random reduction tests but was used all over the place. It doesn't, on the other hand, make the tests shorter. Just *hopefully* more clear. I only cleaned up a few tests this way. If we like this it'd probably be worth grabbing others.
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.
We added a fancy method to provide random realistic test data to the
reduction tests in #54910. This uses that to remove some of the more
esoteric machinations in the agg tests. This will marginally increase
the coverage of the serialiation tests and, more importantly, remove
some mysterious value generation code that only really made sense for
random reduction tests but was used all over the place. It doesn't, on
the other hand, make the tests shorter. Just hopefully more clear.
I only cleaned up a few tests this way. If we like this it'd probably be
worth grabbing others.