[#13173] Fix SearchAccountRequestsActionTest #13257
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #13173
Credits to @domoberzin for helping me debug this!
Problem
SearchAccountRequestsActionTest
inserts Datastore-version of account request documents into Solr viaputDocuments(dataBundle)
SearchAccountRequestsAction
searches usingsqlLogic.searchAccountRequestsInWholeSystem
, which leads tosqlsearch.AccountRequestSearchManager::getEntityFromDocument
getting called. But since Solr only contains Datastore-version account request documents (which do not have UUID as ID), it will lead to anIllegalArgumentException
when trying to parse the ID into a UUID.Solution
sqlsearch.AccountRequestSearchManager::getEntityFromDocument
to get account request using email and institute, instead of ID, since email and institute already uniquely identifies an account requestTesting
Run the following command:
Notes
AccountRequestSearchManager
: 1 for Datastore and 1 for SQL. Both versions are called to find account requests from Solr inSearchAccountRequestsAction
. But only Datastore-version account request documents are inserted. Do we need to insert in the SQL-version account request documents as well? If yes,XXXSearchManager
needs a way to differentiate between Datastore-version documents and SQL-version documents. But we will probably not fix this, since this test will likely be phased out after the migration is complete. A new migrated test will need to insert in SQL-version documents.SearchInstructorActionTest
andSearchStudentActionTest
fail? Because the SQL-version ofInstructorSearchManager
andStudentSearchManager
search using email and institute, which is the same as their Datastore counterparts.