Skip to content
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

Move query builder caching check to dedicated tests #43238

Merged
merged 5 commits into from
Jun 27, 2019

Conversation

cbuescher
Copy link
Member

Currently AbstractQueryTestCase#testToQuery checks the search context cachable
flag. This is a bit fragile due to the high randomization of query builders
performed by this general test. Also we might only rarely check the
"interesting" cases because they rarely get generated when fully randomizing the
query builder.

This change moved the general checks out ot #testToQuery and instead adds
dedicated cache tests for those query builders that exhibit something other than
the default behaviour.

Closes #43200

Currently `AbstractQueryTestCase#testToQuery` checks the search context cachable
flag. This is a bit fragile due to the high randomization of query builders
performed by this general test. Also we might only rarely check the
"interesting" cases because they rarely get generated when fully randomizing the
query builder.

This change moved the general checks out ot #testToQuery and instead adds
dedicated cache tests for those query builders that exhibit something other than
the default behaviour.

Closes elastic#43200
@cbuescher cbuescher added >test Issues or PRs that are addressing/adding tests :Search/Search Search-related issues that do not fall into other categories v8.0.0 v7.2.0 v7.3.0 labels Jun 14, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some minor comments but the change looks good. We could maybe add a dedicated test for range queries since they can also disable caching if they contains now and target a date field ?

@jakelandis jakelandis removed the v7.2.0 label Jun 17, 2019
@cbuescher
Copy link
Member Author

@jimczi thanks, added the two requested tests

@cbuescher
Copy link
Member Author

@elasticmachine run elasticsearch-ci/bwc

@cbuescher
Copy link
Member Author

@jimczi I also added the dedicated test for range queries that you requested, this should be ready for another review now.

@cbuescher
Copy link
Member Author

@elasticmachine update branch

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left one comment, LGTM otherwise

@cbuescher
Copy link
Member Author

@elasticmachine run elasticsearch-ci/default-distro

@cbuescher cbuescher merged commit a4b97b6 into elastic:master Jun 27, 2019
cbuescher pushed a commit that referenced this pull request Jun 27, 2019
Currently `AbstractQueryTestCase#testToQuery` checks the search context cachable
flag. This is a bit fragile due to the high randomization of query builders
performed by this general test. Also we might only rarely check the
"interesting" cases because they rarely get generated when fully randomizing the
query builder.

This change moved the general checks out ot #testToQuery and instead adds
dedicated cache tests for those query builders that exhibit something other than
the default behaviour.

Closes #43200
@cbuescher
Copy link
Member Author

Thanks Jim, merged to master and 7.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Search/Search Search-related issues that do not fall into other categories >test Issues or PRs that are addressing/adding tests v7.3.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add dedicated Q.B. cache tests instead of generic testing in AbstractQueryTestCase#testToQuery
4 participants