Skip to content

[7.17] Add a highlighter unit test base class (#85719) #87413

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

Merged
merged 2 commits into from
Jun 7, 2022

Conversation

romseygeek
Copy link
Contributor

The vast majority of our highlighter tests are integration or rest tests, which exercise
the full ES stack but take a long time to run and are difficult to debug. We have a few
unit tests but they are testing very low-level behaviour, and don't interact with the fetch
phase or hit contexts. This commit adds a new HighlighterTestCase base class with some
helper methods that should fill the gap between these two sets of tests. It includes a
method that takes a MapperService, ParsedDocument and SearchSourceBuilder, and then
runs the appropriate highlighter fetch subphase over the resulting hit.

The vast majority of our highlighter tests are integration or rest tests, which exercise
the full ES stack but take a long time to run and are difficult to debug. We have a few
unit tests but they are testing very low-level behaviour, and don't interact with the fetch
phase or hit contexts. This commit adds a new HighlighterTestCase base class with some
helper methods that should fill the gap between these two sets of tests. It includes a
method that takes a MapperService, ParsedDocument and SearchSourceBuilder, and then
runs the appropriate highlighter fetch subphase over the resulting hit.
@romseygeek romseygeek added >test Issues or PRs that are addressing/adding tests :Search Relevance/Highlighting How a query matched a document v7.17.5 labels Jun 6, 2022
@romseygeek romseygeek requested a review from jtibshirani June 6, 2022 10:19
@romseygeek romseygeek self-assigned this Jun 6, 2022
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Jun 6, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@romseygeek romseygeek merged commit b4fab9c into elastic:7.17 Jun 7, 2022
@romseygeek romseygeek deleted the highlight/base-test-7x branch June 7, 2022 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Search Relevance/Highlighting How a query matched a document Team:Search Meta label for search team >test Issues or PRs that are addressing/adding tests v7.17.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants