diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-05-04 17:02:08 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-05-04 17:02:08 +0900 |
commit | 812dd06d512ab7774b375ce45aa9235aafc99911 (patch) | |
tree | 34cc187b9a70ad95967dff67f3efa397424b9aee /spec/spec_helper.rb | |
parent | 47c8e06cefb7396c6f08b9908bd34dd21c8d08b0 (diff) | |
download | gitlab-ce-812dd06d512ab7774b375ce45aa9235aafc99911.tar.gz |
Introduce Redis helpers. Rename BuildTraceChunkFlushToDbWorker to Ci::BuildTraceChunkFlushWorker.
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index cc61cd7d838..b4fc596a751 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -86,6 +86,7 @@ RSpec.configure do |config| config.include WaitForRequests, :js config.include LiveDebugger, :js config.include MigrationsHelpers, :migration + config.include RedisHelpers if ENV['CI'] # This includes the first try, i.e. tests will be run 4 times before failing. @@ -146,21 +147,27 @@ RSpec.configure do |config| end config.around(:each, :clean_gitlab_redis_cache) do |example| - Gitlab::Redis::Cache.with(&:flushall) + redis_cache_cleanup! example.run - Gitlab::Redis::Cache.with(&:flushall) + redis_cache_cleanup! end config.around(:each, :clean_gitlab_redis_shared_state) do |example| - Gitlab::Redis::SharedState.with(&:flushall) - Sidekiq.redis(&:flushall) + redis_shared_state_cleanup! example.run - Gitlab::Redis::SharedState.with(&:flushall) - Sidekiq.redis(&:flushall) + redis_shared_state_cleanup! + end + + config.around(:each, :clean_gitlab_redis_queues) do |example| + redis_queues_cleanup! + + example.run + + redis_queues_cleanup! end # The :each scope runs "inside" the example, so this hook ensures the DB is in the |