Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[wip] Changes to support Rails 6.1 #2400

Closed
wants to merge 29 commits into from
Closed

Conversation

JonRowe
Copy link
Member

@JonRowe JonRowe commented Nov 2, 2020

@benoittgt these are your changes, feel free to edit this PRs title / description.

.travis.yml Outdated Show resolved Hide resolved

copy_file 'spec/support/default_preview_path'
chmod 'spec/support/default_preview_path', 0755
gsub_file 'spec/support/default_preview_path',
/ExampleApp/,
Rails.application.class.parent.to_s
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we doing this? It should be replaced not removed no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had errors like undefined method 'parent' for ExampleApp::Application:Class . I noticed that this gsub is not needed anymore.

@@ -24,7 +24,11 @@ def initialize(message)

def matches?(mailbox)
@mailbox = mailbox
@receiver = ApplicationMailbox.router.send(:match_to_mailbox, inbound_email)
if ApplicationMailbox.router.respond_to?(:mailbox_for)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be conditionally defining the method based on this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I will make the change

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched back because I add and error on ActionMailbox and I find it more complicated to duplicated all the block. Maybe you prefer in a method? No problem if you want to push another solution on this branch. :)

On script/run_build

An error occurred while loading spec_helper.
Failure/Error: if ApplicationMailbox.router.respond_to?(:mailbox_for)

NameError:
  uninitialized constant RSpec::Rails::Matchers::ActionMailbox::ReceiveInboundEmail::ApplicationMailbox
# ./spec/spec_helper.rb:27:in `<top (required)>'
No examples found.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we do not want to evaluate every-time ApplicationMailbox.router.respond_to?(:mailbox_for) when method is called. I will switch back and fix the error.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benoittgt
Copy link
Member

Sorry @JonRowe I should have open a PR instead of pushing to your branch.

@benoittgt benoittgt force-pushed the wip-rails-6-1-dev branch 3 times, most recently from 515ec09 to 131390e Compare November 3, 2020 20:41
@benoittgt
Copy link
Member

benoittgt commented Nov 3, 2020

CI is nearly full green. Our jruby errors may be linked to mikel/mail#912
I will also look at issues in "allow failures", it seems easy to fix.

@benoittgt benoittgt force-pushed the wip-rails-6-1-dev branch 3 times, most recently from e81da14 to bcdba00 Compare November 8, 2020 21:59
@benoittgt
Copy link
Member

ATM I am not able to reproduce failing build on jruby localy. I switched to last jruby release instead of head.

JonRowe and others added 10 commits November 17, 2020 08:36
jruby not moved because there is too many issues with it at the moment.

Next step fix :
- fix ruby 3
- fix flacky test with "mountable_engine?" error
- add JRuby
Error was

+  1) InboxMailbox route email to properly mailbox
+     Failure/Error:
+       expect(InboxMailbox)
+         .to receive_inbound_email(to: "replies@example.com")
+
+     ArgumentError:
+       wrong number of arguments (given 1, expected 0)
+     # /home/runner/work/rspec-rails/bundle/ruby/3.0.0/gems/actionmailbox-6.0.3.4/lib/action_mailbox/test_helper.rb:16:in `create_inbound_email_from_mail'
+     # ./spec/mailboxes/inbox_mailbox_spec.rb:6:in `block (2 levels) in <top (required)>'

It should be fixed with Rails 6.1 rails/rails#35904
Co-authored-by: Jon Rowe <hello@jonrowe.co.uk>
@benoittgt benoittgt mentioned this pull request Nov 22, 2020
3 tasks
@benoittgt
Copy link
Member

@JonRowe what do you think about merging it to rails-6-1-dev? I will reopen a PR with Rails master branch to see if we have something that could break rspec-rails.

@JonRowe
Copy link
Member Author

JonRowe commented Nov 24, 2020

Er this needs picking apart and cleaning up, its way to confused right now.

@benoittgt
Copy link
Member

benoittgt commented Nov 24, 2020

Ok sorry.

The thing is rails-6-1-dev is getting too much behind main? Should we rebase main into rails-6-1-dev first? It will remove lot's of commits from here.

Something like: https://github.com/rspec/rspec-rails/compare/rails-6-1-dev...rails-6-1-dev-to-github-actions?expand=1

@benoittgt
Copy link
Member

Ok. ATM I see no need to keep this PR open.

Contributions to rails-6-1-dev should be smaller. rails-6-1-dev has no issue with Ruby3 and the Rails RC1, so I think we are pretty good.

@benoittgt benoittgt closed this Nov 26, 2020
@benoittgt benoittgt deleted the wip-rails-6-1-dev branch November 28, 2020 20:51
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants