Skip to content

Commit

Permalink
DEV: Add USE_TURBO option to docker rake task (#7811)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielwaterworth authored and pmusaraj committed Jun 26, 2019
1 parent 14a64e7 commit 68d54d8
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions lib/tasks/docker.rake
Expand Up @@ -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")
Expand All @@ -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"]

Expand Down Expand Up @@ -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"]
Expand Down

0 comments on commit 68d54d8

Please sign in to comment.