-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Action View tests using Ruby 3.1.0-dev fails since https://github.com/ruby/ruby/pull/4586 #42678
Comments
They have been failing since ruby/ruby#4586 , which introduces I'm working on fixing them and have no idea how to address Action View failures yet. rails/actionview/lib/action_view/base.rb Line 247 in f263530
Here are some debug result.
diff --git a/actionview/lib/action_view/base.rb b/actionview/lib/action_view/base.rb
index 295f403eba..fbe6d1ce8c 100644
--- a/actionview/lib/action_view/base.rb
+++ b/actionview/lib/action_view/base.rb
@@ -244,6 +244,7 @@ def _run(method, template, locals, buffer, add_to_stack: true, &block)
_old_output_buffer, _old_virtual_path, _old_template = @output_buffer, @virtual_path, @current_template
@current_template = template if add_to_stack
@output_buffer = buffer
+ binding.irb
public_send(method, locals, buffer, &block)
ensure
@output_buffer, @virtual_path, @current_template = _old_output_buffer, _old_virtual_path, _old_template
% cd actionview
% bin/test test/template/render_test.rb:454
Run options: --seed 39654
# Running:
From: /Users/yahonda/src/github.com/rails/rails/actionview/lib/action_view/base.rb @ line 247 :
242:
243: def _run(method, template, locals, buffer, add_to_stack: true, &block)
244: _old_output_buffer, _old_virtual_path, _old_template = @output_buffer, @virtual_path, @current_template
245: @current_template = template if add_to_stack
246: @output_buffer = buffer
=> 247: binding.irb
248: public_send(method, locals, buffer, &block)
249: ensure
250: @output_buffer, @virtual_path, @current_template = _old_output_buffer, _old_virtual_path, _old_template
251: end
252:
irb(#<#<Class:0x000000010a2aa3e0>:0x000000010a2a9378>):001:0> method
=> "___sers_yahonda_src_github_com_rails_rails_actionview_test_fixtures_test__partial_name_local_variable_erb__3477429999150118233_6060"
irb(#<#<Class:0x000000010a2aa3e0>:0x000000010a2a9378>):002:0> locals
=> {}
irb(#<#<Class:0x000000010a2aa3e0>:0x000000010a2a9378>):003:0> buffer
=> ""
irb(#<#<Class:0x000000010a2aa3e0>:0x000000010a2a9378>):004:0> block
=> #<Proc:0x000000010a38f198 /Users/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/partial_renderer.rb:251>
irb(#<#<Class:0x000000010a2aa3e0>:0x000000010a2a9378>):005:0> public_send(method, locals, buffer, &block)
F
Failure:
CachedCollectionViewRenderTest#test_render_partial_without_object_or_collection_does_not_generate_partial_name_local_variable [/Users/yahonda/src/github.com/rails/rails/actionview/test/template/render_test.rb:454]:
[ActionView::Template::Error] exception expected, not
Class: <SyntaxError>
Message: <"syntax error, unexpected '<'\n<%= partial_name_local_variabl...\n^\nunterminated string meets end of file\n... partial_name_local_variable %>\n... ^\n">
---Backtrace---
<internal:ast>:67:in `of'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/error_highlight/core_ext.rb:19:in `to_s'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/did_you_mean/core_ext/name_error.rb:15:in `to_s'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/irb.rb:646:in `message'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/irb.rb:646:in `full_message'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/irb.rb:646:in `handle_exception'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/irb.rb:586:in `block (2 levels) in eval_input'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/irb.rb:758:in `signal_status'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/irb.rb:548:in `block in eval_input'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/irb/ruby-lex.rb:251:in `block (2 levels) in each_top_level_statement'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/irb/ruby-lex.rb:233:in `loop'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/irb/ruby-lex.rb:233:in `block in each_top_level_statement'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/irb/ruby-lex.rb:232:in `catch'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/irb/ruby-lex.rb:232:in `each_top_level_statement'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/irb.rb:547:in `eval_input'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/irb.rb:481:in `block in run'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/irb.rb:480:in `catch'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/irb.rb:480:in `run'
/Users/yahonda/.rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/irb.rb:961:in `irb'
<internal:prelude>:5:in `irb'
/Users/yahonda/src/github.com/rails/rails/actionview/lib/action_view/base.rb:247:in `_run'
/Users/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:154:in `block in render'
/Users/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:209:in `instrument'
/Users/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:354:in `instrument_render_template'
/Users/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:152:in `render'
/Users/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/partial_renderer.rb:251:in `block in render_partial_template'
/Users/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:207:in `block in instrument'
/Users/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/Users/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:207:in `instrument'
/Users/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/partial_renderer.rb:246:in `render_partial_template'
/Users/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/partial_renderer.rb:237:in `render'
/Users/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/renderer.rb:81:in `render_partial_to_object'
/Users/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/renderer.rb:53:in `render_partial'
/Users/yahonda/src/github.com/rails/rails/actionview/lib/action_view/helpers/rendering_helper.rb:45:in `render'
/Users/yahonda/src/github.com/rails/rails/actionview/test/template/render_test.rb:455:in `block in test_render_partial_without_object_or_collection_does_not_generate_partial_name_local_variable'
--------------- |
When the original source code is erb, RubyVM::AST.of does not work well. rails/rails#42678.
When the original source code is erb, RubyVM::AST.of does not work well. rails/rails#42678. ruby/error_highlight@b1572761a6
Thank you for your trouble. This is not an intentional side effect. I've just pushed a fix that suppress a SyntaxError during error_highlight, so could you give it a try again? Thanks! |
I have confirmed this issue has been resolved. Thanks for the fix. % ruby -v
ruby 3.1.0dev (2021-07-02T07:48:20Z master 3a95834739) [x86_64-darwin21]
% bin/test test/template/render_test.rb:454
Run options: --seed 35817
# Running:
...
Finished in 0.350065s, 8.5698 runs/s, 42.8492 assertions/s.
3 runs, 15 assertions, 0 failures, 0 errors, 0 skips
%
|
Action View tests using Ruby 3.1.0-dev fails since ruby/ruby#4586 Refer https://buildkite.com/rails/rails/builds/78944#5ae555e6-0f48-4b8d-bd0f-fd722dee783f for CI failures.
Steps to reproduce
Expected behavior
It should pass.
Actual behavior
System configuration
Rails version: main branch
Ruby version:ruby 3.1.0dev (2021-07-02T01:49:17Z master 8ebb5e23eb) [x86_64-darwin21]
The text was updated successfully, but these errors were encountered: