DEV: Add USE_TURBO option to docker rake task (#7811)

This commit is contained in:
Daniel Waterworth 2019-06-26 16:54:39 +01:00 committed by Penar Musaraj
parent 14a64e7c4c
commit 68d54d818a
1 changed files with 21 additions and 7 deletions

View File

@ -112,7 +112,14 @@ task 'docker:test' do
# for js tests
ENV["SKIP_MULTISITE"] = "1" if ENV["JS_ONLY"]
@good &&= run_or_fail("bundle exec rake db:create")
db_rake_task_prefix =
if ENV['USE_TURBO']
'parallel'
else
'db'
end
@good &&= run_or_fail("bundle exec rake #{db_rake_task_prefix}:create")
if ENV["INSTALL_OFFICIAL_PLUGINS"]
@good &&= run_or_fail("bundle exec rake plugin:install_all_official")
@ -122,11 +129,14 @@ task 'docker:test' do
@good &&= run_or_fail("bundle exec rake plugin:update_all")
end
if ENV["SKIP_PLUGINS"]
@good &&= run_or_fail("bundle exec rake db:migrate")
else
@good &&= run_or_fail("LOAD_PLUGINS=1 bundle exec rake db:migrate")
end
command_prefix =
if ENV["SKIP_PLUGINS"]
""
else
"LOAD_PLUGINS=1 "
end
@good &&= run_or_fail("#{command_prefix}bundle exec rake #{db_rake_task_prefix}:migrate")
puts "travis_fold:end:prepare_tests" if ENV["TRAVIS"]
@ -160,7 +170,11 @@ task 'docker:test' do
puts "Running spec subset #{subset + 1} of #{total}"
end
@good &&= run_or_fail("bundle exec rspec #{params.join(' ')}".strip)
if ENV['USE_TURBO']
@good &&= run_or_fail("bundle exec ./bin/turbo_rspec #{params.join(' ')}".strip)
else
@good &&= run_or_fail("bundle exec rspec #{params.join(' ')}".strip)
end
end
unless ENV["SKIP_PLUGINS"]