Skip to content

Commit 37584d0

Browse files
test: Add Rails 7.2 to Appraisals (#1242)
* test: Add Rails 7.2 to Appraisals
1 parent c28588e commit 37584d0

File tree

21 files changed

+114
-108
lines changed

21 files changed

+114
-108
lines changed

.github/actions/test_gem/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ runs:
9595
run: |
9696
# 💎 Install dependencies and generate appraisals 💎
9797
bundle install --quiet --jobs=3 --retry=4
98+
bundle exec appraisal clean
9899
bundle exec appraisal generate
99100
working-directory: "${{ steps.setup.outputs.gem_dir }}"
100101

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
# Appraisals
1414
instrumentation/**/gemfiles
15+
instrumentation/**/tmp/**/*
1516

1617
# Sqlite file for tests
1718
instrumentation/active_record/db
@@ -26,3 +27,4 @@ instrumentation/active_record/db
2627
.ruby-version
2728

2829
tags
30+
!**/*/.gitkeep

instrumentation/action_mailer/Appraisals

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
#
55
# SPDX-License-Identifier: Apache-2.0
66

7-
appraise 'rails-6.1' do
8-
gem 'rails', '~> 6.1.0'
9-
end
10-
11-
appraise 'rails-7.0' do
12-
gem 'rails', '~> 7.0.0'
13-
end
14-
15-
appraise 'rails-7.1' do
16-
gem 'rails', '~> 7.1.0'
7+
%w[6.1.0 7.0.0 7.1.0].each do |version|
8+
appraise "action_mailer-#{version}" do
9+
gem 'rails', "~> #{version}"
10+
end
1711
end
1812

1913
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
20-
appraise 'rails-7.2' do
21-
gem 'rails', '~> 7.2.0'
14+
%w[7.2.0].each do |version|
15+
appraise "action_mailer-#{version}" do
16+
gem 'rails', "~> #{version}"
17+
end
18+
end
19+
20+
appraise 'action_mailer-latest' do
21+
gem 'rails'
2222
end
2323
end

instrumentation/action_pack/Appraisals

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
#
55
# SPDX-License-Identifier: Apache-2.0
66

7-
appraise 'rails-6.1' do
8-
gem 'rails', '~> 6.1.0'
9-
end
10-
11-
appraise 'rails-7.0' do
12-
gem 'rails', '~> 7.0.0'
13-
end
14-
15-
appraise 'rails-7.1' do
16-
gem 'rails', '~> 7.1.0'
7+
%w[6.1.0 7.0.0 7.1.0].each do |version|
8+
appraise "rails-#{version}" do
9+
gem 'rails', "~> #{version}"
10+
end
1711
end
1812

1913
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
20-
appraise 'rails-7.2' do
21-
gem 'rails', '~> 7.2.0'
14+
%w[7.2.0].each do |version|
15+
appraise "rails-#{version}" do
16+
gem 'rails', "~> #{version}"
17+
end
18+
end
19+
20+
appraise 'rails-latest' do
21+
gem 'rails'
2222
end
2323
end

instrumentation/action_pack/test/opentelemetry/instrumentation/action_pack/handlers/action_controller_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
let(:exporter) { EXPORTER }
1717
let(:spans) { exporter.finished_spans }
1818
let(:span) { exporter.finished_spans.last }
19-
let(:rails_app) { DEFAULT_RAILS_APP }
19+
let(:rails_app) { AppConfig.initialize_app }
2020
let(:config) { {} }
2121

2222
# Clear captured spans

instrumentation/action_pack/test/test_helper.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,3 @@
2222
c.use 'OpenTelemetry::Instrumentation::ActionPack'
2323
c.add_span_processor span_processor
2424
end
25-
26-
# Create a globally available Rails app, this should be used in test unless
27-
# specifically testing behaviour with different initialization configs.
28-
DEFAULT_RAILS_APP = AppConfig.initialize_app
29-
Rails.application = DEFAULT_RAILS_APP

instrumentation/action_pack/test/test_helpers/app_config.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#
55
# SPDX-License-Identifier: Apache-2.0
66

7-
class Application < Rails::Application; end
87
require 'action_controller/railtie'
8+
class Application < Rails::Application; end
99
require_relative 'middlewares'
1010
require_relative 'controllers'
1111
require_relative 'routes'
@@ -30,7 +30,7 @@ def initialize_app(use_exceptions_app: false, remove_rack_tracer_middleware: fal
3030
case Rails.version
3131
when /^6\.1/
3232
apply_rails_6_1_configs(new_app)
33-
when /^7\./
33+
when /^7|8\./
3434
apply_rails_7_configs(new_app)
3535
end
3636

instrumentation/action_view/Appraisals

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
#
55
# SPDX-License-Identifier: Apache-2.0
66

7-
appraise 'rails-6.1' do
8-
gem 'rails', '~> 6.1.0'
9-
end
10-
11-
appraise 'rails-7.0' do
12-
gem 'rails', '~> 7.0.0'
13-
end
14-
15-
appraise 'rails-7.1' do
16-
gem 'rails', '~> 7.1.0'
7+
%w[6.1.0 7.0.0 7.1.0].each do |version|
8+
appraise "action_view-#{version}" do
9+
gem 'rails', "~> #{version}"
10+
end
1711
end
1812

1913
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
20-
appraise 'rails-7.2' do
21-
gem 'rails', '~> 7.2.0'
14+
%w[7.2.0].each do |version|
15+
appraise "rails-#{version}" do
16+
gem 'rails', "~> #{version}"
17+
end
18+
end
19+
20+
appraise 'rails-latest' do
21+
gem 'rails'
2222
end
2323
end

instrumentation/active_job/Appraisals

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
end
1111
end
1212

13-
appraise 'activejob-latest' do
14-
gem 'activejob'
13+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
14+
%w[7.2.0].each do |version|
15+
appraise "activejob-#{version}" do
16+
gem 'activejob', "~> #{version}"
17+
end
18+
end
19+
20+
appraise 'activejob-latest' do
21+
gem 'activejob'
22+
end
1523
end

instrumentation/active_record/Appraisals

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@
44
#
55
# SPDX-License-Identifier: Apache-2.0
66

7-
appraise 'activerecord-6.1' do
8-
gem 'activerecord', '~> 6.1.0'
9-
end
10-
11-
appraise 'activerecord-7.0' do
12-
gem 'activerecord', '~> 7.0.0'
13-
end
14-
15-
appraise 'activerecord-7.1' do
16-
gem 'activerecord', '~> 7.1.0'
7+
%w[6.1.0 7.0.0 7.1.0].each do |version|
8+
appraise "activerecord-#{version}" do
9+
gem 'sqlite3', '~> 1.4'
10+
gem 'activerecord', "~> #{version}"
11+
end
1712
end
1813

1914
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.1.0')
20-
appraise 'activerecord-7.2' do
21-
gem 'activerecord', '~> 7.2.0'
15+
%w[7.2.0].each do |version|
16+
appraise "activerecord-#{version}" do
17+
gem 'sqlite3', '~> 1.4'
18+
gem 'activerecord', "~> #{version}"
19+
end
20+
end
21+
22+
appraise 'activerecord-latest' do
23+
gem 'sqlite3', '>= 2.1'
24+
gem 'activerecord'
2225
end
2326
end

0 commit comments

Comments
 (0)