Skip to content

Commit 46734cd

Browse files
committed
[TEST] Execute tests in the test:all Rake task manually, to prevent dependency loading errors
Should prevent errors like: .../elasticsearch-rails/elasticsearch-rails/test/test_helper.rb:21:in `require': cannot load such file -- rails/version (LoadError) from .../elasticsearch-rails/elasticsearch-rails/test/test_helper.rb:21:in `<top (required)>' See: * https://api.travis-ci.org/jobs/18002966/log.txt?deansi=true * http://build.elasticsearch.com/view/Clients/job/es-rails_core/ES_V=1.x_nightly,GEMFILE=4.0.gemfile,RUBY_V=2.0.0-p247,label=not-es/lastCompletedBuild/consoleText
1 parent 3c1a0ee commit 46734cd

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ before_script:
2929
- rake bundle:install
3030

3131
script:
32-
- SERVER=start TEST_CLUSTER_COMMAND=/usr/share/elasticsearch/bin/elasticsearch TEST_BUNDLE_GEMFILE=$TEST_BUNDLE_GEMFILE bundle exec rake test:all
32+
- SERVER=launch TEST_CLUSTER_COMMAND=/usr/share/elasticsearch/bin/elasticsearch TEST_BUNDLE_GEMFILE=$TEST_BUNDLE_GEMFILE bundle exec rake test:all
3333

3434
notifications:
3535
disable: true

Rakefile

+19-14
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,31 @@ namespace :test do
6565
desc "Run integration tests in all subprojects"
6666
task :integration do
6767
Rake::Task['test:ci_reporter'].invoke if ENV['CI']
68-
subprojects.each do |project|
69-
puts '-'*80
70-
sh "cd #{__current__.join(project)} && unset BUNDLE_GEMFILE &&" +
71-
%Q| #{ ENV['TEST_BUNDLE_GEMFILE'] ? "BUNDLE_GEMFILE=#{ENV['TEST_BUNDLE_GEMFILE']}" : '' }| +
72-
" bundle exec rake test:integration"
73-
puts "\n"
74-
end
68+
69+
# 1/ elasticsearch-model
70+
#
71+
puts '-'*80
72+
sh "cd #{__current__.join('elasticsearch-model')} && unset BUNDLE_GEMFILE &&" +
73+
%Q| #{ ENV['TEST_BUNDLE_GEMFILE'] ? "BUNDLE_GEMFILE=#{ENV['TEST_BUNDLE_GEMFILE']}" : '' }| +
74+
" bundle exec rake test:integration"
75+
puts "\n"
76+
77+
# 2/ elasticsearch-rails
78+
#
79+
puts '-'*80
80+
sh "cd #{__current__.join('elasticsearch-rails')} && unset BUNDLE_GEMFILE &&" +
81+
" bundle exec rake test:integration"
82+
puts "\n"
83+
7584
Rake::Task['test:coveralls'].invoke if ENV['CI'] && defined?(RUBY_VERSION) && RUBY_VERSION > '1.9'
7685
end
7786

7887
desc "Run all tests in all subprojects"
7988
task :all do
8089
Rake::Task['test:ci_reporter'].invoke if ENV['CI']
81-
subprojects.each do |project|
82-
puts '-'*80
83-
sh "cd #{__current__.join(project)} && unset BUNDLE_GEMFILE &&" +
84-
%Q| #{ ENV['TEST_BUNDLE_GEMFILE'] ? "BUNDLE_GEMFILE=#{ENV['TEST_BUNDLE_GEMFILE']}" : '' }| +
85-
" bundle exec rake test:all"
86-
puts "\n"
87-
end
90+
91+
Rake::Task['test:unit'].invoke
92+
Rake::Task['test:integration'].invoke
8893
end
8994

9095
task :coveralls do

0 commit comments

Comments
 (0)