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

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

diff --git a/lib/tasks/docker.rake b/lib/tasks/docker.rake
index 534a3d2..05d847d 100644
--- a/lib/tasks/docker.rake
+++ b/lib/tasks/docker.rake
@@ -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"]

GitHub sha: 68d54d81

1 Like