DEV: Introduce TemporaryRedis and unset DISCOURSE_* env vars in the themes:isolated_test rake task (#13401)

The `themes:isolated_test` rake task will now unset all `DISCOURSE_*` env variables if `UNSET_DISCOURSE_ENV_VARS` env var is set and will also spin up a temporary redis server so the unicorn web server that's spun up for the tests doesn't leak into the "main" redis server.
This commit is contained in:
Osama Sayegh
2021-06-23 07:38:43 +03:00
committed by GitHub
parent 30c7a9b06d
commit d3a3d1b94c
3 changed files with 129 additions and 2 deletions

View File

@ -42,7 +42,10 @@ task "qunit:test", [:timeout, :qunit_path] do |_, args|
"UNICORN_PID_PATH" => "#{Rails.root}/tmp/pids/unicorn_test_#{port}.pid", # So this can run alongside development
"UNICORN_PORT" => port.to_s,
"UNICORN_SIDEKIQS" => "0",
"DISCOURSE_SKIP_CSS_WATCHER" => "1"
"DISCOURSE_SKIP_CSS_WATCHER" => "1",
"UNICORN_LISTENER" => "127.0.0.1:#{port}",
"LOGSTASH_UNICORN_URI" => nil,
"UNICORN_WORKERS" => "3"
},
"#{Rails.root}/bin/unicorn -c config/unicorn.conf.rb",
pgroup: true