Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not load redis gem when incompatible #4197

Merged
merged 6 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Matrixfile
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@
'rails6-semantic-logger' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ❌ 3.0 / ❌ 3.1 / ❌ 3.2 / ❌ 3.3 / ❌ 3.4 / ✅ jruby',
'rails61-semantic-logger' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby'
},
'rails_old_redis' => {
'rails-old-redis' => '✅ 2.5 / ✅ 2.6 / ✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby',
},
'action_cable' => {
# FIXME: Enable the test for JRuby after fixing `log writing failed. closed stream` in CircleCI.
'rails5-mysql2' => '✅ 2.5 / ✅ 2.6 / ❌ 2.7 / ❌ 3.0 / ❌ 3.1 / ❌ 3.2 / ❌ 3.3 / ❌ 3.4 / ❌ jruby',
Expand Down
9 changes: 9 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@ namespace :spec do
t.rspec_opts = args.to_a.join(' ')
end

# Tests if Datadog::Tracing::Contrib::ActiveSupport::Cache::Redis::Patcher does not eager load
# ActiveSupport::Cache::RedisCacheStore when the version of Redis present is too old to be compatible.
# @see Datadog::Tracing::Contrib::ActiveSupport::Cache::Redis::Patcher#patch_redis_cache_store?
desc '' # "Explicitly hiding from `rake -T`"
RSpec::Core::RakeTask.new(:rails_old_redis) do |t, args|
t.pattern = 'spec/datadog/tracing/contrib/rails/cache_spec.rb'
t.rspec_opts = args.to_a.join(' ')
end

desc '' # "Explicitly hiding from `rake -T`"
RSpec::Core::RakeTask.new(:hanami) do |t, args|
t.pattern = 'spec/datadog/tracing/contrib/hanami/**/*_spec.rb'
Expand Down
10 changes: 10 additions & 0 deletions appraisal/jruby-9.2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,16 @@
gem 'i18n', '1.8.7', platform: :jruby # Removal pending: https://github.com/ruby-i18n/i18n/issues/555#issuecomment-772112169
end

appraise 'rails-old-redis' do
# All dependencies except Redis < 4 are not important, they are just required to run Rails tests.
gem 'redis', '< 4'
gem 'rails', '~> 6.1.0'
gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby
gem 'sprockets', '< 4'
gem 'lograge', '~> 0.11'
gem 'net-smtp'
end

appraise 'resque2-redis3' do
gem 'redis', '< 4.0'
gem 'resque', '>= 2.0'
Expand Down
10 changes: 10 additions & 0 deletions appraisal/jruby-9.3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@
gem 'rails_semantic_logger', '~> 4.0'
end

appraise 'rails-old-redis' do
# All dependencies except Redis < 4 are not important, they are just required to run Rails tests.
gem 'redis', '< 4'
gem 'rails', '~> 6.1.0'
gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby
gem 'sprockets', '< 4'
gem 'lograge', '~> 0.11'
gem 'net-smtp'
end

appraise 'resque2-redis3' do
gem 'redis', '~> 3.0'
gem 'resque', '>= 2.0'
Expand Down
10 changes: 10 additions & 0 deletions appraisal/jruby-9.4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@
gem 'net-smtp'
end

appraise 'rails-old-redis' do
# All dependencies except Redis < 4 are not important, they are just required to run Rails tests.
gem 'redis', '< 4'
gem 'rails', '~> 6.1.0'
gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby
gem 'sprockets', '< 4'
gem 'lograge', '~> 0.11'
gem 'net-smtp'
end

appraise 'resque2-redis3' do
gem 'redis', '< 4.0'
gem 'resque', '>= 2.0'
Expand Down
9 changes: 9 additions & 0 deletions appraisal/ruby-2.5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,15 @@
gem 'rails_semantic_logger', '~> 4.0'
end

appraise 'rails-old-redis' do
# All dependencies except Redis < 4 are not important, they are just required to run Rails tests.
gem 'redis', '< 4'
gem 'rails', '~> 6.1.0'
gem 'pg', '>= 1.1', platform: :ruby
gem 'sprockets', '< 4'
gem 'lograge', '~> 0.11'
end

appraise 'resque2-redis3' do
gem 'redis', '< 4.0'
gem 'resque', '>= 2.0'
Expand Down
9 changes: 9 additions & 0 deletions appraisal/ruby-2.6.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@
gem 'rails_semantic_logger', '~> 4.0'
end

appraise 'rails-old-redis' do
# All dependencies except Redis < 4 are not important, they are just required to run Rails tests.
gem 'redis', '< 4'
gem 'rails', '~> 6.1.0'
gem 'pg', '>= 1.1', platform: :ruby
gem 'sprockets', '< 4'
gem 'lograge', '~> 0.11'
end

appraise 'resque2-redis3' do
gem 'redis', '~> 3.0'
gem 'resque', '>= 2.0'
Expand Down
9 changes: 9 additions & 0 deletions appraisal/ruby-2.7.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@
gem 'rails_semantic_logger', '~> 4.0'
end

appraise 'rails-old-redis' do
# All dependencies except Redis < 4 are not important, they are just required to run Rails tests.
gem 'redis', '< 4'
gem 'rails', '~> 6.1.0'
gem 'pg', '>= 1.1', platform: :ruby
gem 'sprockets', '< 4'
gem 'lograge', '~> 0.11'
end

appraise 'resque2-redis3' do
gem 'redis', '< 4.0'
gem 'resque', '>= 2.0'
Expand Down
9 changes: 9 additions & 0 deletions appraisal/ruby-3.0.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
gem 'rails', '~> 7.1.0'
end

appraise 'rails-old-redis' do
# All dependencies except Redis < 4 are not important, they are just required to run Rails tests.
gem 'redis', '< 4'
gem 'rails', '~> 6.1.0'
gem 'pg', '>= 1.1', platform: :ruby
gem 'sprockets', '< 4'
gem 'lograge', '~> 0.11'
end

appraise 'resque2-redis3' do
gem 'redis', '< 4.0'
gem 'resque', '>= 2.0'
Expand Down
9 changes: 9 additions & 0 deletions appraisal/ruby-3.1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
gem 'rails', '~> 7.1.0'
end

appraise 'rails-old-redis' do
# All dependencies except Redis < 4 are not important, they are just required to run Rails tests.
gem 'redis', '< 4'
gem 'rails', '~> 6.1.0'
gem 'pg', '>= 1.1', platform: :ruby
gem 'sprockets', '< 4'
gem 'lograge', '~> 0.11'
end

appraise 'resque2-redis3' do
gem 'redis', '< 4.0'
gem 'resque', '>= 2.0'
Expand Down
9 changes: 9 additions & 0 deletions appraisal/ruby-3.2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
gem 'rails', '~> 7.1.0'
end

appraise 'rails-old-redis' do
# All dependencies except Redis < 4 are not important, they are just required to run Rails tests.
gem 'redis', '< 4'
gem 'rails', '~> 6.1.0'
gem 'pg', '>= 1.1', platform: :ruby
gem 'sprockets', '< 4'
gem 'lograge', '~> 0.11'
end

appraise 'resque2-redis3' do
gem 'redis', '< 4.0'
gem 'resque', '>= 2.0'
Expand Down
9 changes: 9 additions & 0 deletions appraisal/ruby-3.3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
gem 'rails', '~> 7.1.0'
end

appraise 'rails-old-redis' do
# All dependencies except Redis < 4 are not important, they are just required to run Rails tests.
gem 'redis', '< 4'
gem 'rails', '~> 6.1.0'
gem 'pg', '>= 1.1', platform: :ruby
gem 'sprockets', '< 4'
gem 'lograge', '~> 0.11'
end

appraise 'resque2-redis3' do
gem 'redis', '< 4.0'
gem 'resque', '>= 2.0'
Expand Down
9 changes: 9 additions & 0 deletions appraisal/ruby-3.4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
gem 'rails', '~> 7.1.0'
end

appraise 'rails-old-redis' do
# All dependencies except Redis < 4 are not important, they are just required to run Rails tests.
gem 'redis', '< 4'
gem 'rails', '~> 6.1.0'
gem 'pg', '>= 1.1', platform: :ruby
gem 'sprockets', '< 4'
gem 'lograge', '~> 0.11'
end

appraise 'resque2-redis3' do
gem 'redis', '< 4.0'
gem 'resque', '>= 2.0'
Expand Down
41 changes: 41 additions & 0 deletions gemfiles/jruby_9.2_rails_old_redis.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions gemfiles/jruby_9.3_rails_old_redis.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions gemfiles/jruby_9.4_rails_old_redis.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions gemfiles/ruby_2.5_rails_old_redis.gemfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading