[7.17] Add a highlighter unit test base class (#85719)#87413
Merged
romseygeek merged 2 commits intoelastic:7.17from Jun 7, 2022
Merged
[7.17] Add a highlighter unit test base class (#85719)#87413romseygeek merged 2 commits intoelastic:7.17from
romseygeek merged 2 commits intoelastic:7.17from
Conversation
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.
Collaborator
|
Pinging @elastic/es-search (Team:Search) |
jtibshirani
approved these changes
Jun 6, 2022
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.
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.