Skip to content

Commit

Permalink
test: Add logger to test_helper in some Rails-related libraries (#1345)
Browse files Browse the repository at this point in the history
* test: Add logger to Apprasials for Rails 6.1, 7.0

For action_mailer, action_pack, action_view, delayed_job, and rails
the tests started failing with an uninitialized constant error:
  /opt/hostedtoolcache/Ruby/3.3.6/x64/lib/ruby/gems/3.3.0/gems/
activesupport-6.1.7.10/lib/active_support/logger_thread_safe_level.rb
:16:in `<module:LoggerThreadSafeLevel>': uninitialized constant
ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)

      Logger::Severity.constants.each do |severity|
      ^^^^^^

Adding the logger library explicitly to the Appraisal resolves the
error.

* test: require logger in test_helper

Co-authored-by: Ariel Valentin <arielvalentin@users.noreply.github.com>

---------

Co-authored-by: Ariel Valentin <arielvalentin@users.noreply.github.com>
  • Loading branch information
kaylareopelle and arielvalentin authored Jan 16, 2025
1 parent 07c9cf4 commit b840de9
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions instrumentation/action_mailer/test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#
# SPDX-License-Identifier: Apache-2.0

require 'logger'
require 'bundler/setup'
Bundler.require(:default, :development, :test)

Expand Down
1 change: 1 addition & 0 deletions instrumentation/action_pack/test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#
# SPDX-License-Identifier: Apache-2.0

require 'logger'
require 'bundler/setup'
Bundler.require(:default, :development, :test)

Expand Down
1 change: 1 addition & 0 deletions instrumentation/action_view/test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#
# SPDX-License-Identifier: Apache-2.0

require 'logger'
require 'bundler/setup'
Bundler.require(:default, :development, :test)

Expand Down
1 change: 1 addition & 0 deletions instrumentation/delayed_job/test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#
# SPDX-License-Identifier: Apache-2.0

require 'logger'
require 'bundler/setup'
Bundler.require(:default, :development, :test)

Expand Down
1 change: 1 addition & 0 deletions instrumentation/rails/test/instrumentation/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#
# SPDX-License-Identifier: Apache-2.0

require 'logger'
require 'bundler/setup'
Bundler.require(:default, :development, :test)

Expand Down
1 change: 1 addition & 0 deletions instrumentation/rails/test/railtie/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
ENV['RACK_ENV'] = 'test'
ENV['RAILS_ENV'] = 'test'

require 'logger'
require 'bundler/setup'
Bundler.require(:default, :development, :test)

Expand Down

0 comments on commit b840de9

Please sign in to comment.