diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 18:38:24 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 18:38:24 +0000 |
commit | 983a0bba5d2a042c4a3bbb22432ec192c7501d82 (patch) | |
tree | b153cd387c14ba23bd5a07514c7c01fddf6a78a0 /spec/spec_helper.rb | |
parent | a2bddee2cdb38673df0e004d5b32d9f77797de64 (diff) | |
download | gitlab-ce-983a0bba5d2a042c4a3bbb22432ec192c7501d82.tar.gz |
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
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! |