Test with Solr
If your tests require a running solr instance, you will need to configure and boot solr before they run in CircleCI.
The Easy Way
In some cases, we can start solr automatically. In particular, if you’re
using ruby and the sunspot_solr gem, we’ll run
rake sunspot:solr:start by default, and it should Just Work.
If you’re using a library or module with similar functionality (i.e. one that provides a bundled solr, and a wrapper for booting it), please contact us so that we can extend our inference to make it work automatically!
The Hard Way
Even if we aren’t able to do things automatically,
is installed on your build system. It will need to be configured with your
schema.xml, and booted via circle.yml.
Here’s an example of how to do so:
database: post: - cp -R /opt/solr-4.3.1 $HOME/solr - cp config/schema.xml $HOME/solr/example/solr/collection1/conf # optional: - cp config/solrconfig.xml $HOME/solr/example/solr/collection1/conf - cd $HOME/solr/example; java -jar start.jar >> $HOME/solr.log: background: true
This configuration does three things. You may need to fine-tune the exact commands to match your needs, but they should:
Copy a skeletal solr installation from
/opt/solr-4.3.1into your home directory.
Copy your configuration (
schema.xmlat least, and
solrconfig.xmlif you need it) into place.
Launch solr as a background process.
Solr, when started this way, will be running under
and logging to
Please contact us and let us know if you’re using solr this way! Your feedback helps us keep our documentation up to date, and our services as useable as possible.