summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/environments/test.rb2
-rw-r--r--config/initializers/session_store.rb20
2 files changed, 13 insertions, 9 deletions
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 2d5e7addcd3..955540837d3 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -30,4 +30,6 @@ Gitlab::Application.configure do
config.active_support.deprecation = :stderr
config.eager_load = false
+
+ config.cache_store = :null_store
end
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index 04ed9e90df5..d7c5432da76 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -9,12 +9,14 @@ begin
rescue
end
-Gitlab::Application.config.session_store(
- :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
- key: '_gitlab_session',
- secure: Gitlab.config.gitlab.https,
- httponly: true,
- expire_after: Settings.gitlab['session_expire_delay'] * 60,
- path: (Gitlab::Application.config.relative_url_root.nil?) ? '/' : Gitlab::Application.config.relative_url_root
-)
+unless Rails.env.test?
+ Gitlab::Application.config.session_store(
+ :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
+ key: '_gitlab_session',
+ secure: Gitlab.config.gitlab.https,
+ httponly: true,
+ expire_after: Settings.gitlab['session_expire_delay'] * 60,
+ path: (Gitlab::Application.config.relative_url_root.nil?) ? '/' : Gitlab::Application.config.relative_url_root
+ )
+end