-
Notifications
You must be signed in to change notification settings - Fork 104
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
Fix test suite for Rails 7 #178
Open
voxik
wants to merge
2
commits into
sass:master
Choose a base branch
from
voxik:rails-7-isolation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is in preparation to be able to run the tests in isolation, because recent versions of Rails does not allow multiple to calls to `initialize!`.
This is to prevent test errors in recent versions of Rails such as: ~~~ SassRailsTest#test_setup_works: FrozenError: can't modify frozen Array: [] railties (7.0.4.2) lib/rails/engine.rb:574:in `unshift' railties (7.0.4.2) lib/rails/engine.rb:574:in `block in <class:Engine>' railties (7.0.4.2) lib/rails/initializable.rb:32:in `instance_exec' railties (7.0.4.2) lib/rails/initializable.rb:32:in `run' railties (7.0.4.2) lib/rails/initializable.rb:61:in `block in run_initializers' usr/share/ruby/tsort.rb:228:in `block in tsort_each' usr/share/ruby/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' usr/share/ruby/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from' usr/share/ruby/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from' usr/share/ruby/tsort.rb:431:in `each_strongly_connected_component_from' usr/share/ruby/tsort.rb:421:in `block in each_strongly_connected_component_from' railties (7.0.4.2) lib/rails/initializable.rb:50:in `each' railties (7.0.4.2) lib/rails/initializable.rb:50:in `tsort_each_child' usr/share/ruby/tsort.rb:415:in `call' usr/share/ruby/tsort.rb:415:in `each_strongly_connected_component_from' usr/share/ruby/tsort.rb:421:in `block in each_strongly_connected_component_from' railties (7.0.4.2) lib/rails/initializable.rb:50:in `each' railties (7.0.4.2) lib/rails/initializable.rb:50:in `tsort_each_child' usr/share/ruby/tsort.rb:415:in `call' usr/share/ruby/tsort.rb:415:in `each_strongly_connected_component_from' usr/share/ruby/tsort.rb:349:in `block in each_strongly_connected_component' usr/share/ruby/tsort.rb:347:in `each' usr/share/ruby/tsort.rb:347:in `call' usr/share/ruby/tsort.rb:347:in `each_strongly_connected_component' usr/share/ruby/tsort.rb:226:in `tsort_each' usr/share/ruby/tsort.rb:205:in `tsort_each' railties (7.0.4.2) lib/rails/initializable.rb:60:in `run_initializers' railties (7.0.4.2) lib/rails/application.rb:372:in `initialize!' railties (7.0.4.2) lib/rails/railtie.rb:226:in `public_send' railties (7.0.4.2) lib/rails/railtie.rb:226:in `method_missing' builddir/build/BUILD/sassc-rails-2.1.2/usr/share/gems/gems/sassc-rails-2.1.2/test/sassc_rails_test.rb:48:in `initialize_dev!' builddir/build/BUILD/sassc-rails-2.1.2/usr/share/gems/gems/sassc-rails-2.1.2/test/sassc_rails_test.rb:57:in `test_setup_works' minitest (5.17.0) lib/minitest/test.rb:102:in `block (3 levels) in run' minitest (5.17.0) lib/minitest/test.rb:199:in `capture_exceptions' minitest (5.17.0) lib/minitest/test.rb:97:in `block (2 levels) in run' minitest (5.17.0) lib/minitest.rb:296:in `time_it' minitest (5.17.0) lib/minitest/test.rb:96:in `block in run' minitest (5.17.0) lib/minitest.rb:391:in `on_signal' minitest (5.17.0) lib/minitest/test.rb:247:in `with_info_handler' minitest (5.17.0) lib/minitest/test.rb:95:in `run' minitest (5.17.0) lib/minitest.rb:1051:in `run_one_method' minitest (5.17.0) lib/minitest.rb:365:in `run_one_method' minitest (5.17.0) lib/minitest.rb:352:in `block (2 levels) in run' minitest (5.17.0) lib/minitest.rb:351:in `each' minitest (5.17.0) lib/minitest.rb:351:in `block in run' minitest (5.17.0) lib/minitest.rb:391:in `on_signal' minitest (5.17.0) lib/minitest.rb:378:in `with_info_handler' minitest (5.17.0) lib/minitest.rb:350:in `run' minitest (5.17.0) lib/minitest.rb:182:in `block in __run' minitest (5.17.0) lib/minitest.rb:182:in `map' minitest (5.17.0) lib/minitest.rb:182:in `__run' minitest (5.17.0) lib/minitest.rb:159:in `run' minitest (5.17.0) lib/minitest.rb:83:in `block in autorun' rails test /builddir/build/BUILD/sassc-rails-2.1.2/usr/share/gems/gems/sassc-rails-2.1.2/test/sassc_rails_test.rb:56 ~~~ This is caused by multiple calls to `initialize!` method and very likely due to this commit in Rails: rails/rails@fe43770
LGTM. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Running the test suite against Rails 7, I observe errors such as:
This seems to be due to
initialize!
called multiple times and specifically caused by rails/rails@fe43770The proposed fix is to run the test cases in isolation using
ActiveSupport::Testing::Isolation