-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Feature Request
Currently the only way to test changes to our solr is through manual verification. We would like a way to be able to run tests against a certain solr configuration, likely using the helper run_solr_query method, to verify things like search rankings, sort orderings, and edition-aware edition ranking, etc. This issue will be considered complete when these integration tests can be run locally against a solr container; but in a future issue, we would like to find a way to integrate them into our CI as well. That integration is considered out-of-scope of this issue.
As a first test, we can create a failing (ie .skip) test that checks the current incorrect behaviour of this sort option (see #11430 (comment) ): https://openlibrary.org/search/authors?q=Tavernier&mode=everything&sort=name . It would likely need to, in the test, (1) spin up a new solr docker container, (2) create ~3 dummy author records to recreate the results of the search, and insert them into solr using existing methods in our code, and call commit, and then (3) check the order is as expected, (4) cleanup and remove the records from solr.
Questions:
- Should it attach to an existing solr, or spin up a fresh, empty solr? Answer: empty solr. The latter allows us to more easily test things by running
copydocsto incorporate certain cases, but is then less reproducible, sincecopydocsis not deterministic. Spinning up a fresh solr will let us copy, but then we can't, for example, perform certain tests around more complicated ranking which require prod-like data. I think we might simply need both. Tests that can be performed without our prod instance are best, since they are deterministic. But we will also need some "live" tests that can check things like rankings. This issue will only cover the first type of tests.
Breakdown
Related files
Refer to this map of common Endpoints:
*
Requirements Checklist
Checklist of requirements that need to be satisfied in order for this issue to be closed:
- [ ]
Stakeholders
Instructions for Contributors
- Before creating a new branch or pushing up changes to a PR, please first run these commands to ensure your repository is up to date, as the pre-commit bot may add commits to your PRs upstream.