views:

27

answers:

1

I'm building a test suite for a python site, powered by hudson. Currently, the workflow for a test run looks like:

  1. Pull down the latest version from the repository.
  2. Create a new mysql db and import schema file and some fixture data.
  3. Run tests, largely powered by webtest, which means not needing to run a web server.
  4. Delete mysql db.

This pattern is similar to how Django handles tests.

I'd like to replicate this pattern for solr; I have a test copy of the schema.xml file in my repository and want to prop up a new solr instance with an empty index at the start of each test and nuke it when done. The schema.xml file could change (much like the mysql schema), which is why it needs to be rebuilt from scratch each time (in addition to good testing hygiene).

I'm finding the solr documentation to be fairly limited in this regard. I'm fine with running solr under jetty, which should simplify matters, but I'm at a loss for how to dynamically create a new solr instance or at least a fresh core on every deployment.

A: 

Use the Solr Admin API to create a new core.

Pascal Dimassimo