Refactor unit tests for vector functions.#48662
Merged
jtibshirani merged 3 commits intoelastic:masterfrom Oct 30, 2019
Merged
Conversation
Collaborator
|
Pinging @elastic/es-search (:Search/Search) |
idjevm
approved these changes
Oct 30, 2019
| } | ||
|
|
||
| public void testDenseVectorFunctions() { | ||
| for (Version indexVersion : Arrays.asList(Version.V_7_4_0, Version.CURRENT)) { |
Contributor
There was a problem hiding this comment.
We have a loop here as we expect a change in every version?
Contributor
Author
There was a problem hiding this comment.
I wasn't planning to add more versions (unless we have more version-dependent changes). The loop is really just to test these two listed versions.
mayya-sharipova
approved these changes
Oct 30, 2019
Contributor
mayya-sharipova
left a comment
There was a problem hiding this comment.
@jtibshirani Thank you, very nice refactoring. I like how the tests are so clearly organized, and very fast to understand. I will adopt your style :)
Contributor
Author
|
Thanks @mayya-sharipova for the review (and @idjevm for taking a look as well!) |
jtibshirani
added a commit
that referenced
this pull request
Oct 30, 2019
This PR performs the following changes: * Split `ScoreScriptUtilsTests` into `DenseVectorFunctionTests` and `SparseVectorFunctionTests`. This will make it easier to delete all sparse vector function tests once we remove support on 8.x. * As much as possible, break up the large test methods into individual tests for each vector function (`cosineSimilarity`, `l2norm`, etc.).
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.
This PR performs the following changes:
ScoreScriptUtilsTestsintoDenseVectorFunctionTestsandSparseVectorFunctionTests. This will make it easier to delete all sparsevector function tests once we remove support on 8.x.
for each vector function (
cosineSimilarity,l2norm, etc.).