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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-06 00:09:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-06 00:09:02 +0300
commit76623c12c136f43f24c3966ed4b469e2c0b434b7 (patch)
tree7c5ec884c25e03e4fea131a4d112a9d0ccfd59b8 /spec/support/redis.rb
parentb042382bbf5a4977c5b5c6b0a9a33f4e8ca8d16d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/redis.rb')
-rw-r--r--spec/support/redis.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/support/redis.rb b/spec/support/redis.rb
new file mode 100644
index 00000000000..8539f202602
--- /dev/null
+++ b/spec/support/redis.rb
@@ -0,0 +1,33 @@
+# frozen_string_literal: true
+
+RSpec.configure do |config|
+ config.after(:each, :redis) do
+ Sidekiq.redis do |connection|
+ connection.redis.flushdb
+ end
+ end
+
+ config.around(:each, :clean_gitlab_redis_cache) do |example|
+ redis_cache_cleanup!
+
+ example.run
+
+ redis_cache_cleanup!
+ end
+
+ config.around(:each, :clean_gitlab_redis_shared_state) do |example|
+ redis_shared_state_cleanup!
+
+ example.run
+
+ redis_shared_state_cleanup!
+ end
+
+ config.around(:each, :clean_gitlab_redis_queues) do |example|
+ redis_queues_cleanup!
+
+ example.run
+
+ redis_queues_cleanup!
+ end
+end