Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Charlton <techguru@byiq.com>2017-07-11 06:35:47 +0300
committerRobert Speicher <robert@gitlab.com>2017-07-11 06:35:47 +0300
commitcb3b4a15e6913bc28ee2ecaab017a4c3f08c438e (patch)
treedc3915aa94508d76df2480a8e26ec4b33797a320 /spec/spec_helper.rb
parent4daa6da5407d235cbe4f7a787eaa29304446a870 (diff)
Support multiple Redis instances based on queue type
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb20
1 files changed, 15 insertions, 5 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index a497b8613bb..dc0bdd9f4c7 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -91,20 +91,30 @@ RSpec.configure do |config|
end
end
- config.around(:each, :caching) do |example|
+ config.around(:each, :use_clean_rails_memory_store_caching) do |example|
caching_store = Rails.cache
- Rails.cache = ActiveSupport::Cache::MemoryStore.new if example.metadata[:caching]
+ Rails.cache = ActiveSupport::Cache::MemoryStore.new
+
example.run
+
Rails.cache = caching_store
end
- config.around(:each, :redis) do |example|
- Gitlab::Redis.with(&:flushall)
+ config.around(:each, :clean_gitlab_redis_cache) do |example|
+ Gitlab::Redis::Cache.with(&:flushall)
+
+ example.run
+
+ Gitlab::Redis::Cache.with(&:flushall)
+ end
+
+ config.around(:each, :clean_gitlab_redis_shared_state) do |example|
+ Gitlab::Redis::SharedState.with(&:flushall)
Sidekiq.redis(&:flushall)
example.run
- Gitlab::Redis.with(&:flushall)
+ Gitlab::Redis::SharedState.with(&:flushall)
Sidekiq.redis(&:flushall)
end