Skip to content

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

Merged
romseygeek merged 2 commits intoelastic:7.17from
romseygeek:highlight/base-test-7x
Jun 7, 2022
Merged

[7.17] Add a highlighter unit test base class (#85719)#87413
romseygeek merged 2 commits intoelastic:7.17from
romseygeek:highlight/base-test-7x

Conversation

@romseygeek
Copy link
Copy Markdown
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
Copy Markdown
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