-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Refactor unit tests for vector functions. #48662
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
Refactor unit tests for vector functions. #48662
Conversation
Pinging @elastic/es-search (:Search/Search) |
} | ||
|
||
public void testDenseVectorFunctions() { | ||
for (Version indexVersion : Arrays.asList(Version.V_7_4_0, Version.CURRENT)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a loop here as we expect a change in every version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 :)
Thanks @mayya-sharipova for the review (and @idjevm for taking a look as well!) |
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 PR performs the following changes:
ScoreScriptUtilsTests
intoDenseVectorFunctionTests
andSparseVectorFunctionTests
. 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.).