Skip to content

Commit

Permalink
Fix issues with specs (#2511)
Browse files Browse the repository at this point in the history
* Fix a crash from ActiveSupport

* Add ostruct for ruby-head
  • Loading branch information
solnic authored Jan 17, 2025
1 parent a1d2941 commit 14ef446
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sentry-delayed_job/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
require "debug/prelude"
rescue LoadError
end

require "logger"

require "active_record"
require "delayed_job"
require "delayed_job_active_record"
Expand Down
2 changes: 2 additions & 0 deletions sentry-opentelemetry/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ git_source(:github) { |name| "https://github.com/#{name}.git" }
# Specify your gem's dependencies in sentry-ruby.gemspec
gemspec

gem "ostruct" if RUBY_VERSION >= "3.4"

gem "opentelemetry-sdk"
gem "opentelemetry-instrumentation-rails"

Expand Down
5 changes: 5 additions & 0 deletions sentry-rails/spec/isolated/active_job_activation.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# frozen_string_literal: true

# Fixing crash:
# activesupport-6.1.7.10/lib/active_support/logger_thread_safe_level.rb:16:in
# . `<module:LoggerThreadSafeLevel>': uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)
require "logger"

# for https://github.com/getsentry/sentry-ruby/issues/1249
require "active_job/railtie"
# Rails 7.2 added HealthCheckController, which requires ActionController
Expand Down
3 changes: 3 additions & 0 deletions sentry-resque/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ git_source(:github) { |name| "https://github.com/#{name}.git" }

# Specify your gem's dependencies in sentry-ruby.gemspec
gemspec

gem "ostruct" if RUBY_VERSION >= "3.4"

gem "sentry-ruby", path: "../sentry-ruby"

gem "resque-retry", "~> 1.8"
Expand Down
2 changes: 2 additions & 0 deletions sentry-ruby/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ rack_version = ENV["RACK_VERSION"]
rack_version = "3.0.0" if rack_version.nil?
gem "rack", "~> #{Gem::Version.new(rack_version)}" unless rack_version == "0"

gem "ostruct" if RUBY_VERSION >= "3.4"

redis_rb_version = ENV.fetch("REDIS_RB_VERSION", "5.0")
gem "redis", "~> #{redis_rb_version}"

Expand Down
2 changes: 2 additions & 0 deletions sentry-sidekiq/spec/sentry/rails_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

return unless ENV["WITH_SENTRY_RAILS"]

require "logger"

require "rails"
require "sentry-rails"
require "spec_helper"
Expand Down
5 changes: 5 additions & 0 deletions sentry-sidekiq/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@

require "sentry-ruby"

# Fixing crash:
# activesupport-6.1.7.10/lib/active_support/logger_thread_safe_level.rb:16:in
# . `<module:LoggerThreadSafeLevel>': uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)
require "logger"

require 'simplecov'

SimpleCov.start do
Expand Down

0 comments on commit 14ef446

Please sign in to comment.