Skip to content

Adding Test for new search prototype #4264

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

Closed
8 tasks
safwanrahman opened this issue Jun 19, 2018 · 3 comments
Closed
8 tasks

Adding Test for new search prototype #4264

safwanrahman opened this issue Jun 19, 2018 · 3 comments
Labels
Accepted Accepted issue on our roadmap Needed: tests Tests are required

Comments

@safwanrahman
Copy link
Member

Upon merging #4211, there will be some code that is not tested.
There should be test for following functionality:

search/documents.py

  • Test that objects returned from PageDocument.get_queryset are indexed only.
    • get_queryset method is overwritten to exclude the files which does not need to be indexed. Need to add test that its working perfectly while adding, updating and deleting the HTMLFile object.
  • Test faceted_search method for both PageDocument and ProjectDocument

search/faceted_search.py

  • Test both FileSearch and ProjectSearch

projects/models.py

  • Test HTMLFile proxy model returns only .html file objects.
  • Test json_file_path, processed_json property and get_processed_json function

projects/tasks.py

  • Need to have some test for _manage_imported_files function to check that HTMLFile objects are creating and deleting successfully and upon deletation, the data is removed from the index.
  • Test HTMLFile and ImportedFile are created separately. (Its very much important for search index as only HTMLFile signal is catched to reindex the file.

search/tests/utils.py

  • Test get_search_query_from_project_file is returning correct query

Need to add any other tests that are useful.

@safwanrahman
Copy link
Member Author

safwanrahman commented Jul 19, 2018

More as following after getting #4368 merged:

  • adding test for bulk_post_create, and bulk_post_delete
  • Test bulk indexing work after build complete.
  • Test previous file got removed from index after build complete
  • Test project.tasks._manage_imported_files function
  • Test ./manage.py reindex_elasticsearch management command
  • Test index_html_file and remove_html_file functions.
  • Test all tasks in readthedocs/search/tasks.py

@stale
Copy link

stale bot commented Jan 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Jan 10, 2019
@stsewd stsewd added the Accepted Accepted issue on our roadmap label Jan 10, 2019
@stale stale bot removed the Status: stale Issue will be considered inactive soon label Jan 10, 2019
@stsewd stsewd added the Needed: tests Tests are required label Mar 1, 2019
@ericholscher
Copy link
Member

We have lots of tests for search now 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Needed: tests Tests are required
Projects
None yet
Development

No branches or pull requests

3 participants