diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-08 00:13:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-08 00:13:35 +0300 |
commit | c12e8312f6021bc8b2d9aa796fde9abc428b6a74 (patch) | |
tree | 055709b8bc11521326bc349d0e3c9872fc6d75cf /spec/support/redis.rb | |
parent | 49018dacf018e4ec9536d0a37619cee286918f10 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/redis.rb')
-rw-r--r-- | spec/support/redis.rb | 51 |
1 files changed, 8 insertions, 43 deletions
diff --git a/spec/support/redis.rb b/spec/support/redis.rb index 421079af8e0..d00d6562966 100644 --- a/spec/support/redis.rb +++ b/spec/support/redis.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +require 'gitlab/redis' RSpec.configure do |config| config.after(:each, :redis) do @@ -7,51 +8,15 @@ RSpec.configure do |config| end end - config.around(:each, :clean_gitlab_redis_cache) do |example| - redis_cache_cleanup! + Gitlab::Redis::ALL_CLASSES.each do |instance_class| + underscored_name = instance_class.store_name.underscore - example.run + config.around(:each, :"clean_gitlab_redis_#{underscored_name}") do |example| + public_send("redis_#{underscored_name}_cleanup!") - 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 - - config.around(:each, :clean_gitlab_redis_trace_chunks) do |example| - redis_trace_chunks_cleanup! + example.run - example.run - - redis_trace_chunks_cleanup! - end - - config.around(:each, :clean_gitlab_redis_rate_limiting) do |example| - redis_rate_limiting_cleanup! - - example.run - - redis_rate_limiting_cleanup! - end - - config.around(:each, :clean_gitlab_redis_sessions) do |example| - redis_sessions_cleanup! - - example.run - - redis_sessions_cleanup! + public_send("redis_#{underscored_name}_cleanup!") + end end end |