Skip to content

Incompatible with Rails 7.2 #164

Open
@ledermann

Description

@ledermann

The gem fails after upgrading an app to Rails 7.2, because ActiveRecord::ConnectionAdapters::ConnectionPool#lock_thread= does not exist anymore. There is a deprecation warning as well:

$ DISABLE_SPRING=1 RAILS_ENV=test bin/rake cypress:run

cypress-rails configuration:
============================
 CYPRESS_RAILS_DIR....................."/Users/ledermann/Projects/solectrus/solectrus"
 CYPRESS_RAILS_CYPRESS_DIR............."/Users/ledermann/Projects/solectrus/solectrus"
 CYPRESS_RAILS_HOST...................."127.0.0.1"
 CYPRESS_RAILS_PORT....................nil
 CYPRESS_RAILS_BASE_PATH..............."/"
 CYPRESS_RAILS_TRANSACTIONAL_SERVER....true
 CYPRESS_RAILS_CYPRESS_OPTS............""

DEPRECATION WARNING: ActiveRecord::ConnectionAdapters::ConnectionPool#connection is deprecated
and will be removed in Rails 8.0. Use #lease_connection instead.
 (called from map at /Users/ledermann/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/cypress-rails-0.7.0/lib/cypress-rails/manages_transactions.rb:61)
Coverage report generated for Cypress, RSpec to /Users/ledermann/Projects/solectrus/solectrus/coverage. 1905 / 2661 LOC (71.59%) covered.
Stopped processing SimpleCov as a previous error not related to SimpleCov has been detected
/Users/ledermann/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/cypress-rails-0.7.0/lib/cypress-rails/manages_transactions.rb:13:in `block in begin_transaction': undefined method `lock_thread=' for an instance of ActiveRecord::ConnectionAdapters::ConnectionPool (NoMethodError)

        connection.pool.lock_thread = true
                       ^^^^^^^^^^^^^^
	from /Users/ledermann/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/cypress-rails-0.7.0/lib/cypress-rails/manages_transactions.rb:11:in `each'
	from /Users/ledermann/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/cypress-rails-0.7.0/lib/cypress-rails/manages_transactions.rb:11:in `begin_transaction'
	from /Users/ledermann/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/cypress-rails-0.7.0/lib/cypress-rails/launches_cypress.rb:20:in `call'
	from /Users/ledermann/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/cypress-rails-0.7.0/lib/cypress-rails/run.rb:11:in `call'
	from /Users/ledermann/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/cypress-rails-0.7.0/exe/cypress-rails:15:in `<main>'

I haven't gone any deeper, but removing the two lines with lock_thread= fixes the problem in my application.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions