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

CI: Rails v8.0 test fix, Rails v7.2 out of beta #2802

Merged
merged 2 commits into from
Aug 12, 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
2 changes: 1 addition & 1 deletion test/environments/rails72/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source 'https://rubygems.org'

gem 'rails', '~> 7.2.0.beta2'
gem 'rails', '~> 7.2.0'
gem 'bootsnap', '>= 1.4.4', require: false

gem 'minitest', '5.2.3'
Expand Down
2 changes: 1 addition & 1 deletion test/multiverse/suites/rails/Envfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

RAILS_VERSIONS = [
[nil, 3.1],
['7.2.0.beta3', 3.1],
['7.2.0', 3.1],
['7.1.0', 2.7],
['7.0.4', 2.7],
['6.1.7', 2.5],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,11 @@ def test_send_data
end

def test_send_stream
# rails/rails@ed68af0 now defers all streaming behavior over to Rack (v3+) itself, so test
# only versions >= 7.2 and < 8.0
skip unless rails_version_at_least?('7.2') && !rails_version_at_least?('8.0.0.alpha')
skip unless rails_version_at_least?('7.2')

get('/data/send_test_stream')

assert_metrics_recorded(['Controller/data/send_test_stream', 'Ruby/ActionController/send_stream'])
assert_metrics_recorded(['Controller/data/send_test_stream'])
end

def test_halted_callback
Expand Down Expand Up @@ -231,7 +230,7 @@ def controller_class
def confirm_key_exists_in_params(node)
assertion_failure = "Expected to find the cache key >>#{DataController::CACHE_KEY}<< in the node params!"
# Rails v7.2+ stores the URI string, so look for the key on the end of it
if rails_version_at_least?('7.2.0.beta1')
if rails_version_at_least?('7.2.0')
assert_match(/#{CGI.escape("/#{DataController::CACHE_KEY}")}/, node.params[:key], assertion_failure)
# Rails < v7.2 stores the params in an array, so confirm it includes the key
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ def test_rails_middleware_records_metrics
def test_rails_routeset_is_instrumented
get('/')

assert_metrics_recorded(
# Rails v8.0+ uses lazy routing
metric = if rails_version_at_least?('8.0.0.alpha')
'Middleware/Rack/Rails::Engine::LazyRouteSet/call'
else
'Middleware/Rack/ActionDispatch::Routing::RouteSet/call'
)
end

assert_metrics_recorded(metric)
end

if Rails::VERSION::MAJOR >= 4
Expand Down
Loading