Runbook
Testing Notes
UI Testing Tasks that involve Elasticsearch
“Add a Post” - creates a new thread and indexes it in ES.
“Add a Response” - creates a new comment and indexes it in ES.
“Search all posts” - runs the search endpoint and returns results from posts and responses. Results appear on the left-hand side by post - responses are grouped under posts, not listed as separate items.
“Show all posts” - use this to filter posts by unread and unanswered. Hits ES to filter. Can test by creating new posts with a second account and filtering by unread, or creating a new post and filtering by unanswered.
“By recent activity” - Sorts posts by various criteria, hitting ES again to do the sort.
“…” → “Edit” - Edits a post or response. Editing the body of the post/response will update the index, and the new text should be searchable. Test both.
“…” → “Delete” - Deletes a post or response - this should remove it from the index so it’s no longer searchable. Test on post and response.
➕ Vote - affects sorting by most votes. Get two accounts, add some votes, see that the sorting is different.
Elasticsearch Rake Tasks
You’ll need a ruby env to run these, most likely. On devstack, you can source devstack_forum_env
in order to get this set up. Then you can change directory into cs_comments_service
and run the rake tasks:
rake search:initialize
Should create the indices but does not populate them.
rake search:validate_indices
Validates that the indices are correct. The output indicates success.
rake search:rebuild_indices
Populates the indices. Oddly, this re-creates them as well, so initialize
isn’t terribly useful.
rake search:catchup[comments_index_name,comment_threads_index_name,minutes,batch_size]
Will index comments/threads created in the last X minutes.
Example:
rake search:catchup[comments_20201009141049692,comment_threads_20201009141049692,10,10]
Finding out the index names can be slightly challenging, since they’re timestamped - best bet is to query ES to find out:
curl http://edx.devstack.elasticsearch7:9200/_cat/indices
- Obviously, replace the domain/port with your environment’s ES server.