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

Experimental Rack 3 support #2646

Merged
merged 2 commits into from Feb 13, 2023
Merged

Experimental Rack 3 support #2646

merged 2 commits into from Feb 13, 2023

Conversation

twalpole
Copy link
Member

@twalpole twalpole commented Feb 13, 2023

Work in progress

@twalpole twalpole changed the title Rack 3 support Experimental Rack 3 support Feb 13, 2023
@twalpole twalpole merged commit f857a99 into master Feb 13, 2023
@AlexWayfer
Copy link

Rack::Handler is deprecated and replaced by Rackup::Handler
Capybara starting Puma...
* Version 6.1.0 , codename: The Way Up
* Min threads: 0, max threads: 4
* Listening on http://127.0.0.1:38457
F

Failures:

  1) index page 
     Failure/Error: visit '/'
     
     NoMethodError:
       undefined method `positive?' for nil:NilClass
     # /home/alex/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.8.1/lib/selenium/webdriver/common/selenium_manager.rb:80:in `run'
     # /home/alex/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.8.1/lib/selenium/webdriver/common/selenium_manager.rb:41:in `driver_path'
     # /home/alex/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.8.1/lib/selenium/webdriver/common/service.rb:107:in `binary_path'
     # /home/alex/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.8.1/lib/selenium/webdriver/common/service.rb:74:in `initialize'
     # /home/alex/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.8.1/lib/selenium/webdriver/common/service.rb:36:in `new'
     # /home/alex/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.8.1/lib/selenium/webdriver/common/service.rb:36:in `firefox'
     # /home/alex/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.8.1/lib/selenium/webdriver/firefox/driver.rb:43:in `initialize'
     # /home/alex/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.8.1/lib/selenium/webdriver/common/driver.rb:53:in `new'
     # /home/alex/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.8.1/lib/selenium/webdriver/common/driver.rb:53:in `for'
     # /home/alex/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.8.1/lib/selenium/webdriver.rb:88:in `for'
     # /home/alex/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/bundler/gems/capybara-f857a99ff069/lib/capybara/selenium/driver.rb:83:in `browser'
     # /home/alex/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/bundler/gems/capybara-f857a99ff069/lib/capybara/selenium/driver.rb:104:in `visit'

@twalpole
Copy link
Member Author

@AlexWayfer what are you trying to say here?

@MSP-Greg
Copy link

MSP-Greg commented Feb 25, 2023

As mentioned - Rack::Handler is deprecated and replaced by Rackup::Handler

The next release of Puma will define Rackup::Handler::Puma if Rackup is defined, and leave the namespace as Rack::Handler::Puma if it is not.

EDIT: At present Rackup sets Rack::Handler equal to Rackup::Handler, see https://github.com/rack/rackup/blob/main/lib/rack/handler.rb. So, when that is removed, this will break...

@AlexWayfer
Copy link

As mentioned - Rack::Handler is deprecated and replaced by Rackup::Handler

I have nothing about Handler.

The next release of Puma will define Rackup::Handler::Puma if Rackup is defined, and leave the namespace as Rack::Handler::Puma if it is not.

So… I have to wait for next Puma 6.x release?

Or what can I do to make tests working with the latest versions of Capybara and Puma?

@MSP-Greg
Copy link

latest versions of Capybara and Puma?

Are you referring to latest versions, as in main/master branch, or latest releases? Also, are you using Rack 2 or Rack 3?

@AlexWayfer
Copy link

AlexWayfer commented Feb 26, 2023

latest versions of Capybara and Puma?

Are you referring to latest versions, as in main/master branch, or latest releases? Also, are you using Rack 2 or Rack 3?

Releases, I believe.

...
  * capybara (3.38.0)
...
  * puma (6.1.0)
...
  * rack (3.0.4.1)
...
  * rackup (2.1.0)
...

Rack 3, as you can see.

My code also was using gem 'capybara', github: 'teamcapybara/capybara', I guess because this PR is still not in a stable release, but… the same error.

And, my message was "why there is no a new release of Capybara?". Or "why it does not work?". It's complicated a bit: I see a PR and I don't understand how to connect Capybara with Rack 3.

@MSP-Greg
Copy link

@AlexWayfer

Thanks. That helps. It's messy, adding in the fact some files were removed from Rack 2 and placed in Rackup. So, you can try specifying a commit with gem 'capybara', github: 'teamcapybara/capybara'. I think things will also work if you can use Rack 2. Not sure about either... I know that turbo-rails runs CI with Capybara 3.38.0, Puma 6.1.0, and Rack 2.x.

@MSP-Greg
Copy link

@twalpole

Re the current issue, you want to get at Rack::Handler::Puma.config, which may be Rackup::Handler::Puma.config. Would it be easier to get at Puma::RackHandler.config, and not bother with the Rack/Rackup namespace? Puma::RackHandler contains the methods that are included in Rack::Handler::Puma or Rackup::Handler::Puma, depending on which is defined. If extend self is added to the module, you can access it directly...

@AlexWayfer
Copy link

So, you can try specifying a commit with gem 'capybara', github: 'teamcapybara/capybara'.

Which one commit? And what changed in master?

I think things will also work if you can use Rack 2.

I don't understand: I have everything supporting Rack 3, including Capybara master with this merged PR.

Yes, it's "experimental". So, do we have an issue and Capybara still not compatible with Rack 3, even in master with this PR, or am I doing something wrong?

@AlexWayfer
Copy link

AlexWayfer commented Mar 6, 2023

Should I create a new issue or how should I test my application with Puma, Capybara and Rack 3 (just the latest stable version)?

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.

None yet

3 participants