tablecheck / dartsass-sprockets

Integrate Dart Sass with Sprockets (Ruby on Rails asset pipeline)
MIT License
35 stars 5 forks source link

Add Railties 6.1 and 7.0 to CI matrix #7

Closed javierjulio closed 8 months ago

javierjulio commented 1 year ago

This is the same approach I submitted for the clockwork gem to keep it simple to run multiple versions of Rails (in this case just railties) in CI without needing multiple gemfiles. Despite the gemspec declaring the dependency as long as we specify this after that, it should install the version specified from the environment variable.

javierjulio commented 1 year ago

@johnnyshields I'm not sure if CI is running here but going off of my fork, the build is green now. Note that the lint rubocop and tests vendor jobs are disabled due to the errors there (details in each commit). I had to remove certain Ruby and Rails versions due to "frozen" related errors. I figure it's worth getting CI green and revisiting each separately. I'm not sure what you wanted to do with each so figure it's best for you to resolve. I realize just adding the tzinfo-data gem is safe and should not pose an issue for other platforms. If you'd prefer what was there originally I can add it back in and retry CI.

javierjulio commented 1 year ago

I tried running tests against railties 7.0.x but they fail with FrozenError: can't modify frozen Array: [] that I'm not sure what could be causing it. I don't know enough about Rails Engines to debug. Here is an example stacktrace of one failed test. Perhaps the way the test setup creates the Rails app has to change for Rails 7.0 compatibility?

Error:
SassRailsTest#test_sass_asset_paths_work:
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'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/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'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/tsort.rb:415:in `call'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/tsort.rb:415:in `each_strongly_connected_component_from'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/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'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/tsort.rb:415:in `call'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/tsort.rb:415:in `each_strongly_connected_component_from'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/tsort.rb:347:in `each'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/tsort.rb:347:in `call'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
    opt/hostedtoolcache/Ruby/3.1.3/x64/lib/ruby/3.1.0/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'
    home/runner/work/dartsass-sprockets/dartsass-sprockets/test/sassc_rails_test.rb:43:in `initialize!'
    home/runner/work/dartsass-sprockets/dartsass-sprockets/test/sassc_rails_test.rb:90:in `test_sass_asset_paths_work'
    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 /home/runner/work/dartsass-sprockets/dartsass-sprockets/test/sassc_rails_test.rb:89
johnnyshields commented 1 year ago

I'll look at this in a few days, thanks!

johnnyshields commented 1 year ago

By the way, I'm looking for volunteers to help with https://github.com/tablecheck/dartsass-sprockets/issues/2.

javierjulio commented 1 year ago

@johnnyshields any chance you've been able to look at this? I figure the errors have to do with Zeitwerk/loader changes but I'm not sure what needs to be updated to resolve. I've tried a bunch of changes before but no luck. 😔

johnnyshields commented 1 year ago

Have not yet.

johnnyshields commented 8 months ago

This issue is fixed and this PR is no longer needed.