Skip to content

A platform for community discussion. Free, open, simple.

DEV: Add `SKIP_DB_CREATE` option to docker:test (#16225)

Jarek Radosze4a92a811395
diff --git a/lib/tasks/docker.rake b/lib/tasks/docker.rake
index 22a80e833cc..2430499ce63 100644
--- a/lib/tasks/docker.rake
+++ b/lib/tasks/docker.rake
@@ -100,8 +100,10 @@ task 'docker:test' do
puts "Starting background redis"
@redis_pid = Process.spawn('redis-server --dir tmp/test_data/redis')
- puts "Initializing postgres"
- system("script/start_test_db.rb --skip-run", exception: true)
+ unless ENV['SKIP_DB_CREATE']
+ puts "Initializing postgres"
+ system("script/start_test_db.rb --skip-run", exception: true)
+ end
puts "Starting postgres"
@pg_pid = Process.spawn("script/start_test_db.rb --skip-setup --exec")
@@ -111,7 +113,9 @@ task 'docker:test' do
# for js tests
ENV["SKIP_MULTISITE"] = "1" if ENV["JS_ONLY"]
- @good &&= run_or_fail("bundle exec rake db:create")
+ unless ENV['SKIP_DB_CREATE']
+ @good &&= run_or_fail("bundle exec rake db:create")
+ end
if ENV['USE_TURBO']
@good &&= run_or_fail("bundle exec rake parallel:create")