Skip to content
Snippets Groups Projects

Change Sidekiq testing mode to `fake` instead of `inline`

Merged Rémy Coutable requested to merge ee-22992-default-sidekiq-to-fake-mode-in-test-env into master
All threads resolved!
1 file
+ 18
1
Compare changes
  • Side-by-side
  • Inline
+ 18
1
@@ -27,7 +27,9 @@ def call(worker_instance, msg, queue)
end
RSpec.configure do |config|
config.after(:each, :sidekiq) do
config.around(:each, :sidekiq) do |example|
Sidekiq::Worker.clear_all
example.run
Sidekiq::Worker.clear_all
end
@@ -36,4 +38,19 @@ def call(worker_instance, msg, queue)
connection.redis.flushdb
end
end
# As we'll review the examples with this tag, we should either:
# - fix the example to not require Sidekiq inline mode (and remove this tag)
# - explicitly keep the inline mode and change the tag for `:sidekiq_inline` instead
config.around(:example, :sidekiq_might_not_need_inline) do |example|
Sidekiq::Worker.clear_all
Sidekiq::Testing.inline! { example.run }
Sidekiq::Worker.clear_all
end
config.around(:example, :sidekiq_inline) do |example|
Sidekiq::Worker.clear_all
Sidekiq::Testing.inline! { example.run }
Sidekiq::Worker.clear_all
end
end
Loading