Disabling cache for test environment

This commit is contained in:
Valery Sizov 2015-11-16 12:18:31 +02:00
parent 5be2191b1a
commit 9e0d443f9e
2 changed files with 13 additions and 9 deletions

View file

@ -30,4 +30,6 @@ Gitlab::Application.configure do
config.active_support.deprecation = :stderr config.active_support.deprecation = :stderr
config.eager_load = false config.eager_load = false
config.cache_store = :null_store
end end

View file

@ -9,6 +9,7 @@ begin
rescue rescue
end end
unless Rails.env.test?
Gitlab::Application.config.session_store( Gitlab::Application.config.session_store(
:redis_store, # Using the cookie_store would enable session replay attacks. :redis_store, # Using the cookie_store would enable session replay attacks.
servers: Gitlab::Application.config.cache_store[1].merge(namespace: 'session:gitlab'), # re-use the Redis config from the Rails cache store servers: Gitlab::Application.config.cache_store[1].merge(namespace: 'session:gitlab'), # re-use the Redis config from the Rails cache store
@ -18,3 +19,4 @@ Gitlab::Application.config.session_store(
expire_after: Settings.gitlab['session_expire_delay'] * 60, expire_after: Settings.gitlab['session_expire_delay'] * 60,
path: (Gitlab::Application.config.relative_url_root.nil?) ? '/' : Gitlab::Application.config.relative_url_root path: (Gitlab::Application.config.relative_url_root.nil?) ? '/' : Gitlab::Application.config.relative_url_root
) )
end