diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-21 18:21:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-21 18:21:10 +0300 |
commit | e33f87ac0fabaab468ce4b457996cc0f1b1bb648 (patch) | |
tree | 8bf0de72a9acac014cfdaddab7d463b208294af2 /spec/spec_helper.rb | |
parent | 5baf990db20a75078684702782c24399ef9eb0fa (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 19d12a0f5cb..fe03621b9bf 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -136,6 +136,7 @@ RSpec.configure do |config| config.include ExpectRequestWithStatus, type: :request config.include IdempotentWorkerHelper, type: :worker config.include RailsHelpers + config.include SidekiqMiddleware if ENV['CI'] || ENV['RETRIES'] # This includes the first try, i.e. tests will be run 4 times before failing. @@ -299,6 +300,22 @@ RSpec.configure do |config| Labkit::Context.with_context { example.run } end + config.around do |example| + with_sidekiq_server_middleware do |chain| + Gitlab::SidekiqMiddleware.server_configurator( + metrics: false, # The metrics don't go anywhere in tests + arguments_logger: false, # We're not logging the regular messages for inline jobs + memory_killer: false, # This is not a thing we want to do inline in tests + # Don't enable this if the request store is active in the spec itself + # This needs to run within the `request_store` around block defined above + request_store: !RequestStore.active? + ).call(chain) + chain.add DisableQueryLimit + + example.run + end + end + config.after do Fog.unmock! if Fog.mock? Gitlab::CurrentSettings.clear_in_memory_application_settings! |