-
Notifications
You must be signed in to change notification settings - Fork 97
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
Require propshaft before railtie #205
Conversation
In Railties test suite, we explicitly add require "propshaft/railtie" to the application.rb. This is similar to what Sprockets used to do: https://github.com/rails/sprockets-rails/blob/2c04236faaacd021b7810289cbac93e962ff14da/lib/sprockets/railtie.rb#L6 Without requiring Propshaft first, we run into this type of error: ``` /home/zzak/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-0.9.0/lib/propshaft/quiet_assets.rb:1:in `<top (required)>': uninitialized constant Propshaft (NameError) class Propshaft::QuietAssets ^^^^^^^^^ from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-0.9.0/lib/propshaft/railtie.rb:3:in `<top (required)>' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/zzak/code/rails/tmp/d20240912-3742241-z13n0d/app/config/application.rb:7:in `block in <top (required)>' from /home/zzak/code/rails/tmp/d20240912-3742241-z13n0d/app/config/application.rb:7:in `each' from /home/zzak/code/rails/tmp/d20240912-3742241-z13n0d/app/config/application.rb:7:in `<top (required)>' from /home/zzak/code/rails/tmp/d20240912-3742241-z13n0d/app/config/environment.rb:2:in `require_relative' from /home/zzak/code/rails/tmp/d20240912-3742241-z13n0d/app/config/environment.rb:2:in `<top (required)>' from /home/zzak/code/rails/tmp/d20240912-3742241-z13n0d/app/test/test_helper.rb:2:in `require_relative' from /home/zzak/code/rails/tmp/d20240912-3742241-z13n0d/app/test/test_helper.rb:2:in `<top (required)>' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from test/models/post_test.rb:1:in `<main>' ```
According to git bisect, this commit triggers https://buildkite.com/rails/rails-nightly/builds/1087#01923f96-5384-4f75-b3a1-8fe2e1002c82 |
… and Rails unit tests This commit workarounds CI failure at https://buildkite.com/rails/rails-nightly/builds/1087#01923f96-5384-4f75-b3a1-8fe2e1002c82 since Propshaft v1.0.1 released that includes rails/propshaft#205 * Steps to reproduce ```ruby export RAILS_STRICT_WARNINGS=1 # Let unit tests failed if some warnings appeared at Rails CI git clone https://github.com/rails/rails cd rails bundle update propshaft --conservative cd actionmailbox bundle exec rake test ``` * Expected behavior It should pass. * Actual behavior It gets the following `warning: loading in progress, circular require considered harmful` and it fails. ```ruby $ bundle update propshaft --conservative $ bundle info propshaft * propshaft (1.0.1) Summary: Deliver assets for Rails. Homepage: https://github.com/rails/propshaft Path: /home/yahonda/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/propshaft-1.0.1 yahonda@myryzen:~/src/github.com/rails/rails$ $ git diff diff --git a/Gemfile.lock b/Gemfile.lock index 15a821945e..293b3f0286 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -412,7 +412,7 @@ GEM pg (1.5.4) prettier_print (1.2.1) prism (0.27.0) - propshaft (0.9.0) + propshaft (1.0.1) actionpack (>= 7.0.0) activesupport (>= 7.0.0) rack $ cd actionmailbox $ bundle exec rake test /home/yahonda/.rbenv/versions/3.3.5/bin/ruby -w -I"lib:test" /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb "test/controllers/ingresses/mailgun/inbound_emails_controller_test.rb" "test/controllers/ingresses/mandrill/inbound_emails_controller_test.rb" "test/controllers/ingresses/postmark/inbound_emails_controller_test.rb" "test/controllers/ingresses/relay/inbound_emails_controller_test.rb" "test/controllers/ingresses/sendgrid/inbound_emails_controller_test.rb" "test/controllers/rails/action_mailbox/inbound_emails_controller_test.rb" "test/generators/mailbox_generator_test.rb" "test/jobs/incineration_job_test.rb" "test/migrations_test.rb" "test/models/table_name_test.rb" "test/unit/inbound_email/incineration_test.rb" "test/unit/inbound_email/message_id_test.rb" "test/unit/inbound_email_test.rb" "test/unit/mail_ext/address_equality_test.rb" "test/unit/mail_ext/address_wrapping_test.rb" "test/unit/mail_ext/addresses_test.rb" "test/unit/mailbox/bouncing_test.rb" "test/unit/mailbox/callbacks_test.rb" "test/unit/mailbox/notifications_test.rb" "test/unit/mailbox/routing_test.rb" "test/unit/mailbox/state_test.rb" "test/unit/relayer_test.rb" "test/unit/router_test.rb" "test/unit/test_helper_test.rb" /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75: warning: /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75: warning: loading in progress, circular require considered harmful - /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-1.0.1/lib/propshaft.rb from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:6:in `<main>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:6:in `select' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:21:in `block in <main>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/controllers/ingresses/mailgun/inbound_emails_controller_test.rb:3:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/test_helper.rb:8:in `<top (required)>' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/test_helper.rb:8:in `require_relative' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/environment.rb:2:in `<top (required)>' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/environment.rb:2:in `require_relative' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/application.rb:7:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler.rb:212:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:44:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:44:in `each' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:55:in `block in require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:55:in `each' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:60:in `block (2 levels) in require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from <internal:/home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require' from <internal:/home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-1.0.1/lib/propshaft.rb:13:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-1.0.1/lib/propshaft/railtie.rb:3:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/testing/strict_warnings.rb:38:in `warn': /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75: warning: /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75: warning: loading in progress, circular require considered harmful - /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-1.0.1/lib/propshaft.rb (ActiveSupport::RaiseWarnings::WarningError) from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:6:in `<main>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:6:in `select' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:21:in `block in <main>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/controllers/ingresses/mailgun/inbound_emails_controller_test.rb:3:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/test_helper.rb:8:in `<top (required)>' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/test_helper.rb:8:in `require_relative' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/environment.rb:2:in `<top (required)>' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/environment.rb:2:in `require_relative' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/application.rb:7:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler.rb:212:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:44:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:44:in `each' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:55:in `block in require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:55:in `each' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:60:in `block (2 levels) in require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from <internal:/home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require' from <internal:/home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-1.0.1/lib/propshaft.rb:13:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-1.0.1/lib/propshaft/railtie.rb:3:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-1.0.1/lib/propshaft/railtie.rb:3:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-1.0.1/lib/propshaft.rb:13:in `<top (required)>' from <internal:/home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require' from <internal:/home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:60:in `block (2 levels) in require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:55:in `each' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:55:in `block in require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:44:in `each' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:44:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler.rb:212:in `require' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/application.rb:7:in `<top (required)>' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/environment.rb:2:in `require_relative' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/environment.rb:2:in `<top (required)>' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/test_helper.rb:8:in `require_relative' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/test_helper.rb:8:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/controllers/ingresses/mailgun/inbound_emails_controller_test.rb:3:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:21:in `block in <main>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:6:in `select' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:6:in `<main>' rake aborted! Command failed with status (1): [ruby -w -I"lib:test" /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb "test/controllers/ingresses/mailgun/inbound_emails_controller_test.rb" "test/controllers/ingresses/mandrill/inbound_emails_controller_test.rb" "test/controllers/ingresses/postmark/inbound_emails_controller_test.rb" "test/controllers/ingresses/relay/inbound_emails_controller_test.rb" "test/controllers/ingresses/sendgrid/inbound_emails_controller_test.rb" "test/controllers/rails/action_mailbox/inbound_emails_controller_test.rb" "test/generators/mailbox_generator_test.rb" "test/jobs/incineration_job_test.rb" "test/migrations_test.rb" "test/models/table_name_test.rb" "test/unit/inbound_email/incineration_test.rb" "test/unit/inbound_email/message_id_test.rb" "test/unit/inbound_email_test.rb" "test/unit/mail_ext/address_equality_test.rb" "test/unit/mail_ext/address_wrapping_test.rb" "test/unit/mail_ext/addresses_test.rb" "test/unit/mailbox/bouncing_test.rb" "test/unit/mailbox/callbacks_test.rb" "test/unit/mailbox/notifications_test.rb" "test/unit/mailbox/routing_test.rb" "test/unit/mailbox/state_test.rb" "test/unit/relayer_test.rb" "test/unit/router_test.rb" "test/unit/test_helper_test.rb" ] /home/yahonda/.rbenv/versions/3.3.5/bin/bundle:25:in `load' /home/yahonda/.rbenv/versions/3.3.5/bin/bundle:25:in `<main>' Tasks: TOP => test (See full trace by running task with --trace) $ ```
Opened rails/rails#53114 to skip v1.0.1 tentatively. |
I'll revert that change in propshaft. |
Sorry this was my fault, I forgot to follow up here but I think we just needed to change the require here to |
… and Rails unit tests This commit workarounds CI failure at https://buildkite.com/rails/rails-nightly/builds/1087#01923f96-5384-4f75-b3a1-8fe2e1002c82 since Propshaft v1.0.1 released that includes rails/propshaft#205 * Steps to reproduce ```ruby export RAILS_STRICT_WARNINGS=1 # Let unit tests failed if some warnings appeared at Rails CI git clone https://github.com/rails/rails cd rails bundle update propshaft --conservative cd actionmailbox bundle exec rake test ``` * Expected behavior It should pass. * Actual behavior It gets the following `warning: loading in progress, circular require considered harmful` and it fails. ```ruby $ bundle update propshaft --conservative $ bundle info propshaft * propshaft (1.0.1) Summary: Deliver assets for Rails. Homepage: https://github.com/rails/propshaft Path: /home/yahonda/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/propshaft-1.0.1 yahonda@myryzen:~/src/github.com/rails/rails$ $ git diff diff --git a/Gemfile.lock b/Gemfile.lock index 15a821945e..293b3f0286 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -412,7 +412,7 @@ GEM pg (1.5.4) prettier_print (1.2.1) prism (0.27.0) - propshaft (0.9.0) + propshaft (1.0.1) actionpack (>= 7.0.0) activesupport (>= 7.0.0) rack $ cd actionmailbox $ bundle exec rake test /home/yahonda/.rbenv/versions/3.3.5/bin/ruby -w -I"lib:test" /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb "test/controllers/ingresses/mailgun/inbound_emails_controller_test.rb" "test/controllers/ingresses/mandrill/inbound_emails_controller_test.rb" "test/controllers/ingresses/postmark/inbound_emails_controller_test.rb" "test/controllers/ingresses/relay/inbound_emails_controller_test.rb" "test/controllers/ingresses/sendgrid/inbound_emails_controller_test.rb" "test/controllers/rails/action_mailbox/inbound_emails_controller_test.rb" "test/generators/mailbox_generator_test.rb" "test/jobs/incineration_job_test.rb" "test/migrations_test.rb" "test/models/table_name_test.rb" "test/unit/inbound_email/incineration_test.rb" "test/unit/inbound_email/message_id_test.rb" "test/unit/inbound_email_test.rb" "test/unit/mail_ext/address_equality_test.rb" "test/unit/mail_ext/address_wrapping_test.rb" "test/unit/mail_ext/addresses_test.rb" "test/unit/mailbox/bouncing_test.rb" "test/unit/mailbox/callbacks_test.rb" "test/unit/mailbox/notifications_test.rb" "test/unit/mailbox/routing_test.rb" "test/unit/mailbox/state_test.rb" "test/unit/relayer_test.rb" "test/unit/router_test.rb" "test/unit/test_helper_test.rb" /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75: warning: /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75: warning: loading in progress, circular require considered harmful - /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-1.0.1/lib/propshaft.rb from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:6:in `<main>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:6:in `select' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:21:in `block in <main>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/controllers/ingresses/mailgun/inbound_emails_controller_test.rb:3:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/test_helper.rb:8:in `<top (required)>' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/test_helper.rb:8:in `require_relative' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/environment.rb:2:in `<top (required)>' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/environment.rb:2:in `require_relative' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/application.rb:7:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler.rb:212:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:44:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:44:in `each' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:55:in `block in require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:55:in `each' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:60:in `block (2 levels) in require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from <internal:/home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require' from <internal:/home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-1.0.1/lib/propshaft.rb:13:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-1.0.1/lib/propshaft/railtie.rb:3:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/testing/strict_warnings.rb:38:in `warn': /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75: warning: /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75: warning: loading in progress, circular require considered harmful - /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-1.0.1/lib/propshaft.rb (ActiveSupport::RaiseWarnings::WarningError) from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:6:in `<main>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:6:in `select' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:21:in `block in <main>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/controllers/ingresses/mailgun/inbound_emails_controller_test.rb:3:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/test_helper.rb:8:in `<top (required)>' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/test_helper.rb:8:in `require_relative' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/environment.rb:2:in `<top (required)>' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/environment.rb:2:in `require_relative' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/application.rb:7:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler.rb:212:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:44:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:44:in `each' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:55:in `block in require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:55:in `each' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:60:in `block (2 levels) in require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from <internal:/home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require' from <internal:/home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-1.0.1/lib/propshaft.rb:13:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-1.0.1/lib/propshaft/railtie.rb:3:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-1.0.1/lib/propshaft/railtie.rb:3:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/propshaft-1.0.1/lib/propshaft.rb:13:in `<top (required)>' from <internal:/home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require' from <internal:/home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:60:in `block (2 levels) in require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:55:in `each' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:55:in `block in require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:44:in `each' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler/runtime.rb:44:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundler.rb:212:in `require' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/application.rb:7:in `<top (required)>' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/environment.rb:2:in `require_relative' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/dummy/config/environment.rb:2:in `<top (required)>' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/test_helper.rb:8:in `require_relative' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/test_helper.rb:8:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/src/github.com/rails/rails/actionmailbox/test/controllers/ingresses/mailgun/inbound_emails_controller_test.rb:3:in `<top (required)>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:21:in `block in <main>' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:6:in `select' from /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb:6:in `<main>' rake aborted! Command failed with status (1): [ruby -w -I"lib:test" /home/yahonda/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb "test/controllers/ingresses/mailgun/inbound_emails_controller_test.rb" "test/controllers/ingresses/mandrill/inbound_emails_controller_test.rb" "test/controllers/ingresses/postmark/inbound_emails_controller_test.rb" "test/controllers/ingresses/relay/inbound_emails_controller_test.rb" "test/controllers/ingresses/sendgrid/inbound_emails_controller_test.rb" "test/controllers/rails/action_mailbox/inbound_emails_controller_test.rb" "test/generators/mailbox_generator_test.rb" "test/jobs/incineration_job_test.rb" "test/migrations_test.rb" "test/models/table_name_test.rb" "test/unit/inbound_email/incineration_test.rb" "test/unit/inbound_email/message_id_test.rb" "test/unit/inbound_email_test.rb" "test/unit/mail_ext/address_equality_test.rb" "test/unit/mail_ext/address_wrapping_test.rb" "test/unit/mail_ext/addresses_test.rb" "test/unit/mailbox/bouncing_test.rb" "test/unit/mailbox/callbacks_test.rb" "test/unit/mailbox/notifications_test.rb" "test/unit/mailbox/routing_test.rb" "test/unit/mailbox/state_test.rb" "test/unit/relayer_test.rb" "test/unit/router_test.rb" "test/unit/test_helper_test.rb" ] /home/yahonda/.rbenv/versions/3.3.5/bin/bundle:25:in `load' /home/yahonda/.rbenv/versions/3.3.5/bin/bundle:25:in `<main>' Tasks: TOP => test (See full trace by running task with --trace) $ ```
In Railties test suite, we explicitly add require "propshaft/railtie" to the application.rb.
rails/rails@5617c997 fixed most of the test failures in that branch.
This is similar to what Sprockets used to do:
https://github.com/rails/sprockets-rails/blob/2c04236faaacd021b7810289cbac93e962ff14da/lib/sprockets/railtie.rb#L6
Without requiring Propshaft first, we run into this type of error: