ruby on rails - Searchkick Failing on Travis CI -
I only integrate Searchkick on my Rail 4.1 app and the construction of my Travis CI just failed. I resolved the first failure by adding elasticsearch service in my .travis.yml, but the order of "reindex" should be done through a rail console, and it is thus failure:
Failure / Error: Unable to find matching line from tracetimeError: trailing error: index missing - Run item.reindex
How do I index a model by issuing "Model.reindex" in Travis CI
Here is my .travis.yml file:
Language: dark red Vm: -? 2.0.0-p247 env: - DB = SQLite - db = mysql - db = PostgreSQL services: - elasticsearch script: - RAILS_ENV = test bundle executive rake db: displace --trace - bundle executive rake db: test: ready - bundle executive Rspec imagery / before_script: - mysql -e 'create database mbb_test' - psql-c 'create database mbb_test;' You postgres bundler_args:. --binstubs = / bundler_stubs
I just found out in my test helper ( To add spec_helper.rb to my case so that the item can be given "reindex" - in each exam:
config.before (: each) item.
A better version
config.before (: each, es: true) if Item.searchkick_index.exists do Are you item. Searchkick_index.delete Item. Taken from Rendex End End
:
Comments
Post a Comment