Fresh solr instance for every hudson test build
I'm building a test suite for a python site, powered by hudson. Currently, the workflow for a test run looks like:
- Pull down the latest version from the repository.
- Create a new mysql db and import schema file and some fixture data.
- Run tests, largely powered by webtest, which means not needing to run a web server.
- 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 so开发者_运维知识库lr instance or at least a fresh core on every deployment.
Use the Solr Admin API to create a new core.
精彩评论