From 9e7cc9afda43f7ebc459484cb917b887ed24d707 Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Mon, 13 Mar 2017 12:23:32 -0700 Subject: [PATCH] Warn when using the Testing API outside of the test env, fixes #3384 --- lib/sidekiq/testing.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/sidekiq/testing.rb b/lib/sidekiq/testing.rb index f4132257..8cfe4fec 100644 --- a/lib/sidekiq/testing.rb +++ b/lib/sidekiq/testing.rb @@ -316,3 +316,9 @@ module Sidekiq end end end + +if defined?(::Rails) && !Rails.env.test? + puts("**************************************************") + puts("⛔️ WARNING: Sidekiq testing API enabled, but this is not the test environment. Your jobs will not go to Redis.") + puts("**************************************************") +end