Skip to content

Commit

Permalink
Require logger in test setup
Browse files Browse the repository at this point in the history
`ActiveSupport::LoggerThreadSafeLevel` depends on `logger`, but doesn't
require it explicitly prior to 7.1. In the real application, the `logger`
is likely required by other components so this is not an issue. But for
this gem's test setup, we need to require it explicitly.
  • Loading branch information
st0012 committed Jan 16, 2025
1 parent 0ba3f9a commit 1af25f9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions test/integration/interruption_adapters_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class InterruptionAdaptersTest < ActiveSupport::TestCase
require 'bundler/setup'
# Remove sidekiq, only resque will be left
$LOAD_PATH.delete_if { |p| p =~ /sidekiq/ }
require 'logger'
require 'job-iteration'
JobIteration::InterruptionAdapters.lookup(:resque)
RUBY
Expand All @@ -23,6 +24,7 @@ class InterruptionAdaptersTest < ActiveSupport::TestCase
require 'bundler/setup'
# Remove sidekiq, only resque will be left
$LOAD_PATH.delete_if { |p| p =~ /sidekiq/ }
require 'logger'
require 'job-iteration'
JobIteration::InterruptionAdapters.lookup(:sidekiq)
RUBY
Expand All @@ -35,6 +37,7 @@ class InterruptionAdaptersTest < ActiveSupport::TestCase
test "loads all available interruption adapters" do
ruby = <<~RUBY
require 'bundler/setup'
require 'logger'
require 'job-iteration'
adapters_to_exclude = [:good_job, :solid_queue, :sqs] # These require a Rails app to be loaded
Expand Down
2 changes: 1 addition & 1 deletion test/support/resque/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# $LOAD_PATH.unshift File.dirname(__FILE__) unless $LOAD_PATH.include?(File.dirname(__FILE__))
require "resque/tasks"

require "logger"
require "job-iteration"
require "active_job"
require "i18n"

require_relative "../jobs"
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
$LOAD_PATH.unshift(File.expand_path("../../lib", __FILE__))
require "minitest/autorun"

require "logger"
require "job-iteration"
require "job-iteration/test_helper"

require "globalid"
require "sidekiq"
require "resque"
require "active_job"
require "active_record"
require "pry"
require "mocha/minitest"
Expand Down

0 comments on commit 1af25f9

Please sign in to comment.