A platform for community discussion. Free, open, simple.
DEV: Support customizing `docker:test:setup` with envs (#24508)
Alan Guo Xiang Tan48f3c638ccdc
diff --git a/lib/tasks/docker.rake b/lib/tasks/docker.rakeindex 0b791b04a88..e1cff04f21d 100644--- a/lib/tasks/docker.rake+++ b/lib/tasks/docker.rake@@ -34,7 +34,7 @@ enddef setup_test_env(setup_multisite: false,create_db: true,- create_parallel_db: false,+ create_parallel_dbs: false,install_all_official: false,update_all_plugins: false,plugins_to_remove: "",@@ -47,7 +47,7 @@ def setup_test_env(success = truesuccess &&= run_or_fail("bundle exec rake db:create") if create_db- success &&= run_or_fail("bundle exec rake parallel:create") if create_parallel_db+ success &&= run_or_fail("bundle exec rake parallel:create") if create_parallel_dbssuccess &&= run_or_fail("bundle exec rake plugin:install_all_official") if install_all_officialsuccess &&= run_or_fail("bundle exec rake plugin:update_all") if update_all_plugins@@ -61,7 +61,7 @@ def setup_test_env(endend- success &&= migrate_databases(parallel: create_parallel_db, load_plugins: load_plugins)+ success &&= migrate_databases(parallel: create_parallel_dbs, load_plugins: load_plugins)successend@@ -83,6 +83,10 @@ def system_tests_parallel_tests_processors_envend# Environment Variables (specific to this rake task)+# => INSTALL_OFFICIAL_PLUGINS set to 1 to install all official plugins+# => UPDATE_ALL_PLUGINS set to 1 to update all plugins+# => LOAD_PLUGINS set to 1 to load plugins+# => CREATE_PARALLEL_DATABASES set to 1 to setup parallel test databasesdesc "Setups up the test environment"task "docker:test:setup" dosetup_redis@@ -91,10 +95,10 @@ task "docker:test:setup" dosetup_test_env(setup_multisite: true,create_db: true,- create_parallel_db: false,- load_plugins: false,- install_all_official: false,- update_all_plugins: false,+ create_parallel_dbs: !!ENV["CREATE_PARALLEL_DATABASES"],+ load_plugins: !!ENV["LOAD_PLUGINS"],+ install_all_official: !!ENV["INSTALL_OFFICIAL_PLUGINS"],+ update_all_plugins: !!ENV["UPDATE_ALL_PLUGINS"],)end@@ -210,7 +214,7 @@ task "docker:test" dosetup_test_env(setup_multisite: !ENV["JS_ONLY"],create_db: !ENV["SKIP_DB_CREATE"],- create_parallel_db: !!ENV["USE_TURBO"],+ create_parallel_dbs: !!ENV["USE_TURBO"],install_all_official: !!ENV["INSTALL_OFFICIAL_PLUGINS"],update_all_plugins: !!ENV["UPDATE_ALL_PLUGINS"],plugins_to_remove: ENV["SKIP_INSTALL_PLUGINS"] || "",