moliware/travis-solr

Gem usage

Closed this issue · 2 comments

tab commented

@moliware thanks for this gem, but I can't understand how its properly use:

My sunspot configuration:

test:
  solr:
    hostname: localhost
    port: 8983
    log_level: WARNING
    path: /solr/default

My travis.yml:

before_script:
  - cp config/sunspot.travis.yml config/sunspot.yml
  - curl -sSL https://raw.githubusercontent.com/moliware/travis-solr/master/travis-solr.sh | SOLR_VERSION=3.6.1 bash

Part of travis-ci logs:

0.00s$ cp config/sunspot.travis.yml config/sunspot.yml
before_script.3
793.35s$ curl -sSL https://raw.githubusercontent.com/moliware/travis-solr/master/travis-solr.sh | SOLR_VERSION=3.6.1 bash
File apache-solr-3.6.1.tgz does not exist. Downloading solr from http://archive.apache.org/dist/lucene/solr/3.6.1/apache-solr-3.6.1.tgz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 83.2M  100 83.2M    0     0   107k      0  0:13:09  0:13:09 --:--:--  108k
Downloaded!
Running with folder apache-solr-3.6.1
Starting solr on port 8983...
Checking if solr is up on http://localhost:8983/solr/admin/cores
Checking if solr is up on http://localhost:8983/solr/admin/cores
Started
SOLR_DOCS not defined, skipping initial indexing

And error when creates an new object and try to index:

    RSolr::Error::Http:
       RSolr::Error::Http - 404 Not Found
       Error:     NOT_FOUND

       URI: http://localhost:8983/solr/default/update?wt=ruby

Looks like your before_script didn't include a SOLR_DOCS definition. i.e:

curl -sSL path_to_travis-solr.sh | SOLR_VERSION=3.6.1 SOLR_CONFS="schema.xml solrconfig.xml" SOLR_DOCS=custom_docs.json

tab commented

@lianyi thank you! Finally all tests completed successfully.