From cceca5f936e29d8e18c1cb07046f0da3a121d44f Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 16 Jun 2023 15:43:45 +1000 Subject: [PATCH] Use Redis for caching in test environment All other environments use it. --- config/environments/test.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/environments/test.rb b/config/environments/test.rb index 71228c5e30..70ebf96780 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -14,7 +14,11 @@ Openfoodnetwork::Application.configure do config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' } # Separate cache stores when running in parallel - config.cache_store = :file_store, Rails.root.join("tmp", "cache", "paralleltests#{ENV['TEST_ENV_NUMBER']}") + config.cache_store = :redis_cache_store, { + driver: :hiredis, + url: ENV.fetch("OFN_REDIS_URL", "redis://localhost:6379/1"), + reconnect_attempts: 1 + } # Show full error reports and disable caching config.consider_all_requests_local = true