summaryrefslogtreecommitdiff
path: root/spec/support/redis.rb
blob: eeeb93fa8119dd0c769cd569d72dec4727dbb1da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# 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

  config.around(:each, :clean_gitlab_redis_trace_chunks) do |example|
    redis_trace_chunks_cleanup!

    example.run

    redis_trace_chunks_cleanup!
  end
end