diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /spec/support/redis.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
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 |