diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-06 00:09:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-06 00:09:02 +0300 |
commit | 76623c12c136f43f24c3966ed4b469e2c0b434b7 (patch) | |
tree | 7c5ec884c25e03e4fea131a4d112a9d0ccfd59b8 /spec/support/redis.rb | |
parent | b042382bbf5a4977c5b5c6b0a9a33f4e8ca8d16d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/redis.rb')
-rw-r--r-- | spec/support/redis.rb | 33 |
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 |