Skip to content
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

Adds Unit tests for NativeEngines990KnnVectorsWriter #2097

Merged

Conversation

shatejas
Copy link
Contributor

@shatejas shatejas commented Sep 12, 2024

Had to separate out the common code in NativeEngines990KnnVectorsWriter to make it easy to write tests. Mocking was difficult to do with the functional interfaces and it was throwing NPE in the test especially with the mock of NativeIndexWriter::flush and NativeIndexWriter::merge where it wasn't able to recognize the mocked writer.

Check List

  • New functionality includes testing.
  • Commits are signed per the DCO using --signoff.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link
Contributor Author

@shatejas shatejas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI fix #2098

@navneet1v
Copy link
Collaborator

Please rebase the code to fix the CIs.

Had to separate out the common code to make it easy to write tests
Mocking was difficult to do with the functional interfaces and it was
throwing NPE in the test especially with the mock of NativeIndexWriter.

Signed-off-by: Tejas Shah <shatejas@amazon.com>
@jmazanec15 jmazanec15 merged commit 0df0613 into opensearch-project:main Sep 13, 2024
27 of 29 checks passed
@shatejas shatejas deleted the native-writer-unit-test branch September 13, 2024 21:21
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 13, 2024
Had to separate out the common code to make it easy to write tests
Mocking was difficult to do with the functional interfaces and it was
throwing NPE in the test especially with the mock of NativeIndexWriter.

Signed-off-by: Tejas Shah <shatejas@amazon.com>
(cherry picked from commit 0df0613)
navneet1v pushed a commit that referenced this pull request Sep 14, 2024
Had to separate out the common code to make it easy to write tests
Mocking was difficult to do with the functional interfaces and it was
throwing NPE in the test especially with the mock of NativeIndexWriter.

Signed-off-by: Tejas Shah <shatejas@amazon.com>
(cherry picked from commit 0df0613)

Co-authored-by: Tejas Shah <shatejas@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants