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

Add Railties 6.1 and 7.0 to CI matrix #7

Closed
wants to merge 9 commits into from

Conversation

javierjulio
Copy link
Contributor

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.

Gemfile Show resolved Hide resolved
@javierjulio javierjulio force-pushed the ci-rails branch 3 times, most recently from 341ad56 to eb89bf8 Compare February 4, 2023 21:44
This was failing because its not run through rake but directly as its a standalone command
Getting this to install in CI is problematic. Not worth running in CI since its EOL and we can still leave it permitted for use.
These are failing. Other builds are not running so we'll remove this for now and add back once we can stabilize CI.
No way to fix this other than to reconfigure rubocop to allow these warnings or update the codebase so they adhere to rubocop.
These fail with the following error:

> Don't know how to build task 'git:submodule:test' (See the list of available tasks with `rake --tasks`)

I'm not sure if this is setup to work as expected so disable for now so CI is green. This can be addressed separately.
@javierjulio
Copy link
Contributor Author

@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
Copy link
Contributor Author

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
Copy link
Contributor

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

@johnnyshields
Copy link
Contributor

By the way, I'm looking for volunteers to help with #2.

@javierjulio
Copy link
Contributor Author

@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
Copy link
Contributor

Have not yet.

@johnnyshields
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants