Skip to content

Create integration tests for solr #11651

@cdrini

Description

@cdrini

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 copydocs to incorporate certain cases, but is then less reproducible, since copydocs is 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

@tfmorris @RayBB @KrishnaShuk

Instructions for Contributors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Lead: @cdriniIssues overseen by Drini (Staff: Team Lead & Solr, Library Explorer, i18n) [managed]Needs: BreakdownThis big issue needs a checklist or subissues to describe a breakdown of work. [managed]Needs: ResponseIssues which require feedback from leadPriority: 2Important, as time permits. [managed]Type: Feature RequestIssue describes a feature or enhancement we'd like to implement. [managed]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions