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

tests: Unify search engine tests into a single test suite #4318

Conversation

frascuchon
Copy link
Member

@frascuchon frascuchon commented Nov 24, 2023

This PR changes and unifies tests related to the search engine.

  • All tests which will return the same results for the different engine implementations are placed in test_commons.py
  • Specific tests for elasticsearch implementation are placed in test_elasticsearch.py
  • Specific tests for opensearch implementation are placed in test_elasticsearch.py

Refs: #4318

Also, define specif tests for each implementation in a separate test suite
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. area: tests Indicates that an issue or pull request is related to the tests language: python Pull requests or issues that update Python code team: backend Indicates that the issue or pull request is owned by the backend team type: refactor Indicates internal refactoring of the code-base labels Nov 24, 2023
@frascuchon frascuchon self-assigned this Nov 24, 2023
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 24, 2023
@frascuchon frascuchon merged commit c553000 into feat/index-records-with-suggestions-for-search-engine Nov 27, 2023
15 of 16 checks passed
@frascuchon frascuchon deleted the refactor/unify-search-engine-tests branch November 27, 2023 05:54
jfcalvo added a commit that referenced this pull request Nov 27, 2023
<!-- Thanks for your contribution! As part of our Community Growers
initiative 🌱, we're donating Justdiggit bunds in your name to reforest
sub-Saharan Africa. To claim your Community Growers certificate, please
contact David Berenstein in our Slack community or fill in this form
https://tally.so/r/n9XrxK once your PR has been merged. -->

# Description

This PR adds support for indexing suggestions when indexing records in
the search index.

In order to be sure that all record attributes are passed when indexing
records, a workaround has been implemented by forcing a record,
responses, and suggestions to refresh before indexing them. Otherwise is
hard to add that info when loading records in the current code base.

This behavior must be reviewed and simplified cc @gabrielmbmb @jfcalvo 

Changes related to tests will be moved into a separate PR since extra
refactoring work must be done. Once this extra PR is merged here, the PR
will be marked as ready for review. Related PR
#4318


Refs: #3849 

Closes #4230

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: José Francisco Calvo <[email protected]>
Co-authored-by: José Francisco Calvo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tests Indicates that an issue or pull request is related to the tests language: python Pull requests or issues that update Python code lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files. team: backend Indicates that the issue or pull request is owned by the backend team type: refactor Indicates internal refactoring of the code-base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants