From d467efce5f3a9de4a75a82475c81861289704d49 Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 20 Sep 2024 21:49:09 -0400 Subject: [PATCH 1/6] Remove lock_thread on connection pool The commit that added lock_thread (f6380859e82193c6a16bdbf2950b933054f65355) notes that > Transaction management is largely ripped straight out of > test_fixtures.rb in Rails The commit that adds lock_thread in Rails -- https://github.com/rails/rails/commit/d6466beb9fff9f2ba4f73673e65f087dd6bba488 -- has some helpful context: > When a system test starts Puma spins up one thread and Capybara spins > up another thread. Because of this when tests are run the database > cannot see what was inserted into the database on teardown. This is > because there are two threads using two different connections. > This change uses the statement cache to lock the threads to using a > single connection ID instead of each not being able to see each other. So lock_thread exists because there are two different threads -- Puma and Capybara -- trying to access the same database but not necessarily seeing the same thing. But! cypress-rails doesn't use Capybara, and more importantly, it doesn't use tests or a test runner written in Ruby at all, so there's only _one_ thread trying to use the database. So we don't need all this thread locking stuff. So let's remove it to make things more compatible with Rails 7.2. --- lib/cypress-rails/manages_transactions.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/cypress-rails/manages_transactions.rb b/lib/cypress-rails/manages_transactions.rb index 484c434..bbcdac7 100644 --- a/lib/cypress-rails/manages_transactions.rb +++ b/lib/cypress-rails/manages_transactions.rb @@ -10,7 +10,6 @@ def begin_transaction @connections = gather_connections @connections.each do |connection| connection.begin_transaction joinable: false, _lazy: false - connection.pool.lock_thread = true end # When connections are established in the future, begin a transaction too @@ -26,7 +25,6 @@ def begin_transaction if connection && !@connections.include?(connection) connection.begin_transaction joinable: false, _lazy: false - connection.pool.lock_thread = true @connections << connection end end @@ -42,7 +40,6 @@ def rollback_transaction @connections.each do |connection| connection.rollback_transaction if connection.transaction_open? - connection.pool.lock_thread = false end @connections.clear From 67cf2bfb7d65931f5a91faa3002ef1afc3dff546 Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 20 Sep 2024 22:03:00 -0400 Subject: [PATCH 2/6] Use #lease_connection instead of #connection in Rails 7.2 Taken from https://github.com/testdouble/cypress-rails/pull/165, hence the coauthor credit. Co-authored-by: Georg Ledermann --- lib/cypress-rails/manages_transactions.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/cypress-rails/manages_transactions.rb b/lib/cypress-rails/manages_transactions.rb index bbcdac7..a09341d 100644 --- a/lib/cypress-rails/manages_transactions.rb +++ b/lib/cypress-rails/manages_transactions.rb @@ -55,7 +55,14 @@ def initialize def gather_connections setup_shared_connection_pool - ActiveRecord::Base.connection_handler.connection_pool_list.map(&:connection) + ActiveRecord::Base.connection_handler.connection_pool_list.map do |pool| + # Rails 7.2+ + if pool.respond_to?(:lease_connection) + pool.lease_connection + else + pool.connection + end + end end # Shares the writing connection pool with connections on From c1da2594a20188537de23fb1f41c922ff256f93e Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 20 Sep 2024 22:48:03 -0400 Subject: [PATCH 3/6] Support both Rails 7.1 and 7.2 in the example app Use symlinks for multiple Gemfiles. --- example/Gemfile | 11 +- example/Gemfile.lock | 178 ++++++++++++++--------------- example/Gemfile_rails71 | 1 + example/Gemfile_rails71.lock | 213 +++++++++++++++++++++++++++++++++++ example/README.md | 39 +++---- script/test_example_app | 33 +++--- 6 files changed, 348 insertions(+), 127 deletions(-) create mode 120000 example/Gemfile_rails71 create mode 100644 example/Gemfile_rails71.lock diff --git a/example/Gemfile b/example/Gemfile index 8646dbe..388c16d 100644 --- a/example/Gemfile +++ b/example/Gemfile @@ -1,6 +1,15 @@ source "https://rubygems.org" -gem "rails" +def rails_version + current_gemfile = File.basename(__FILE__) + + { + "Gemfile" => nil, + "Gemfile_rails71" => "~> 7.1.3" + }.fetch(current_gemfile) +end + +gem "rails", rails_version gem "sqlite3" gem "puma" gem "webpacker" diff --git a/example/Gemfile.lock b/example/Gemfile.lock index 0e8e2b7..b13201e 100644 --- a/example/Gemfile.lock +++ b/example/Gemfile.lock @@ -8,100 +8,96 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3) - actionpack (= 7.1.3) - activesupport (= 7.1.3) + actioncable (7.2.1) + actionpack (= 7.2.1) + activesupport (= 7.2.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.3) - actionpack (= 7.1.3) - activejob (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.1.3) - actionpack (= 7.1.3) - actionview (= 7.1.3) - activejob (= 7.1.3) - activesupport (= 7.1.3) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp + actionmailbox (7.2.1) + actionpack (= 7.2.1) + activejob (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) + mail (>= 2.8.0) + actionmailer (7.2.1) + actionpack (= 7.2.1) + actionview (= 7.2.1) + activejob (= 7.2.1) + activesupport (= 7.2.1) + mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.1.3) - actionview (= 7.1.3) - activesupport (= 7.1.3) + actionpack (7.2.1) + actionview (= 7.2.1) + activesupport (= 7.2.1) nokogiri (>= 1.8.5) racc - rack (>= 2.2.4) + rack (>= 2.2.4, < 3.2) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.3) - actionpack (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) + useragent (~> 0.16) + actiontext (7.2.1) + actionpack (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3) - activesupport (= 7.1.3) + actionview (7.2.1) + activesupport (= 7.2.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.3) - activesupport (= 7.1.3) + activejob (7.2.1) + activesupport (= 7.2.1) globalid (>= 0.3.6) - activemodel (7.1.3) - activesupport (= 7.1.3) - activerecord (7.1.3) - activemodel (= 7.1.3) - activesupport (= 7.1.3) + activemodel (7.2.1) + activesupport (= 7.2.1) + activerecord (7.2.1) + activemodel (= 7.2.1) + activesupport (= 7.2.1) timeout (>= 0.4.0) - activestorage (7.1.3) - actionpack (= 7.1.3) - activejob (= 7.1.3) - activerecord (= 7.1.3) - activesupport (= 7.1.3) + activestorage (7.2.1) + actionpack (= 7.2.1) + activejob (= 7.2.1) + activerecord (= 7.2.1) + activesupport (= 7.2.1) marcel (~> 1.0) - activesupport (7.1.3) + activesupport (7.2.1) base64 bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) base64 (0.2.0) - bigdecimal (3.1.6) + bigdecimal (3.1.8) bootsnap (1.18.3) msgpack (~> 1.2) - builder (3.2.4) - concurrent-ruby (1.2.3) + builder (3.3.0) + concurrent-ruby (1.3.4) connection_pool (2.4.1) crass (1.0.6) date (3.3.4) - drb (2.2.0) - ruby2_keywords - erubi (1.12.0) + drb (2.2.1) + erubi (1.13.0) globalid (1.2.1) activesupport (>= 6.1) - i18n (1.14.1) + i18n (1.14.6) concurrent-ruby (~> 1.0) io-console (0.7.2) - irb (1.11.2) - rdoc + irb (1.14.0) + rdoc (>= 4.0.0) reline (>= 0.4.2) + logger (1.6.1) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -110,30 +106,29 @@ GEM net-imap net-pop net-smtp - marcel (1.0.2) + marcel (1.0.4) mini_mime (1.1.5) - mini_portile2 (2.8.5) - minitest (5.22.2) + mini_portile2 (2.8.7) + minitest (5.25.1) msgpack (1.7.2) - mutex_m (0.2.0) - net-imap (0.4.10) + net-imap (0.4.16) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0.1) + net-smtp (0.5.0) net-protocol - nio4r (2.7.0) - nokogiri (1.16.2) + nio4r (2.7.3) + nokogiri (1.16.7) mini_portile2 (~> 2.8.2) racc (~> 1.4) psych (5.1.2) stringio puma (6.4.2) nio4r (~> 2.0) - racc (1.7.3) + racc (1.8.1) rack (3.1.7) rack-proxy (0.7.7) rack @@ -144,20 +139,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.3) - actioncable (= 7.1.3) - actionmailbox (= 7.1.3) - actionmailer (= 7.1.3) - actionpack (= 7.1.3) - actiontext (= 7.1.3) - actionview (= 7.1.3) - activejob (= 7.1.3) - activemodel (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) + rails (7.2.1) + actioncable (= 7.2.1) + actionmailbox (= 7.2.1) + actionmailer (= 7.2.1) + actionpack (= 7.2.1) + actiontext (= 7.2.1) + actionview (= 7.2.1) + activejob (= 7.2.1) + activemodel (= 7.2.1) + activerecord (= 7.2.1) + activestorage (= 7.2.1) + activesupport (= 7.2.1) bundler (>= 1.15.0) - railties (= 7.1.3) + railties (= 7.2.1) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -165,28 +160,29 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.3) - actionpack (= 7.1.3) - activesupport (= 7.1.3) - irb + railties (7.2.1) + actionpack (= 7.2.1) + activesupport (= 7.2.1) + irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) - rake (13.1.0) - rdoc (6.6.2) + rake (13.2.1) + rdoc (6.7.0) psych (>= 4.0.0) - reline (0.4.2) + reline (0.5.10) io-console (~> 0.5) - ruby2_keywords (0.0.5) + securerandom (0.3.1) semantic_range (3.0.0) sqlite3 (1.7.2) mini_portile2 (~> 2.8.0) - stringio (3.1.0) - thor (1.3.0) + stringio (3.1.1) + thor (1.3.2) timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) + useragent (0.16.10) webpacker (5.4.4) activesupport (>= 5.2) rack-proxy (>= 0.6.1) @@ -196,7 +192,7 @@ GEM websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.13) + zeitwerk (2.6.18) PLATFORMS ruby diff --git a/example/Gemfile_rails71 b/example/Gemfile_rails71 new file mode 120000 index 0000000..6ab7900 --- /dev/null +++ b/example/Gemfile_rails71 @@ -0,0 +1 @@ +Gemfile \ No newline at end of file diff --git a/example/Gemfile_rails71.lock b/example/Gemfile_rails71.lock new file mode 100644 index 0000000..314b2a4 --- /dev/null +++ b/example/Gemfile_rails71.lock @@ -0,0 +1,213 @@ +PATH + remote: .. + specs: + cypress-rails (0.7.1) + puma (>= 3.8.0) + railties (>= 5.2.0) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.1.3) + actionpack (= 7.1.3) + activesupport (= 7.1.3) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (7.1.3) + actionpack (= 7.1.3) + activejob (= 7.1.3) + activerecord (= 7.1.3) + activestorage (= 7.1.3) + activesupport (= 7.1.3) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.1.3) + actionpack (= 7.1.3) + actionview (= 7.1.3) + activejob (= 7.1.3) + activesupport (= 7.1.3) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.2) + actionpack (7.1.3) + actionview (= 7.1.3) + activesupport (= 7.1.3) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.3) + actionpack (= 7.1.3) + activerecord (= 7.1.3) + activestorage (= 7.1.3) + activesupport (= 7.1.3) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.1.3) + activesupport (= 7.1.3) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.3) + activesupport (= 7.1.3) + globalid (>= 0.3.6) + activemodel (7.1.3) + activesupport (= 7.1.3) + activerecord (7.1.3) + activemodel (= 7.1.3) + activesupport (= 7.1.3) + timeout (>= 0.4.0) + activestorage (7.1.3) + actionpack (= 7.1.3) + activejob (= 7.1.3) + activerecord (= 7.1.3) + activesupport (= 7.1.3) + marcel (~> 1.0) + activesupport (7.1.3) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + minitest (>= 5.1) + mutex_m + tzinfo (~> 2.0) + base64 (0.2.0) + bigdecimal (3.1.6) + bootsnap (1.18.3) + msgpack (~> 1.2) + builder (3.2.4) + concurrent-ruby (1.2.3) + connection_pool (2.4.1) + crass (1.0.6) + date (3.3.4) + drb (2.2.0) + ruby2_keywords + erubi (1.12.0) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + io-console (0.7.2) + irb (1.11.2) + rdoc + reline (>= 0.4.2) + loofah (2.22.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.2) + mini_mime (1.1.5) + mini_portile2 (2.8.5) + minitest (5.22.2) + msgpack (1.7.2) + mutex_m (0.2.0) + net-imap (0.4.10) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.4.0.1) + net-protocol + nio4r (2.7.0) + nokogiri (1.16.2) + mini_portile2 (~> 2.8.2) + racc (~> 1.4) + psych (5.1.2) + stringio + puma (6.4.2) + nio4r (~> 2.0) + racc (1.7.3) + rack (3.1.7) + rack-proxy (0.7.7) + rack + rack-session (2.0.0) + rack (>= 3.0.0) + rack-test (2.1.0) + rack (>= 1.3) + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) + rails (7.1.3) + actioncable (= 7.1.3) + actionmailbox (= 7.1.3) + actionmailer (= 7.1.3) + actionpack (= 7.1.3) + actiontext (= 7.1.3) + actionview (= 7.1.3) + activejob (= 7.1.3) + activemodel (= 7.1.3) + activerecord (= 7.1.3) + activestorage (= 7.1.3) + activesupport (= 7.1.3) + bundler (>= 1.15.0) + railties (= 7.1.3) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.1.3) + actionpack (= 7.1.3) + activesupport (= 7.1.3) + irb + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rake (13.1.0) + rdoc (6.6.2) + psych (>= 4.0.0) + reline (0.4.2) + io-console (~> 0.5) + ruby2_keywords (0.0.5) + semantic_range (3.0.0) + sqlite3 (1.7.2) + mini_portile2 (~> 2.8.0) + stringio (3.1.0) + thor (1.3.0) + timeout (0.4.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + webpacker (5.4.4) + activesupport (>= 5.2) + rack-proxy (>= 0.6.1) + railties (>= 5.2) + semantic_range (>= 2.3.0) + webrick (1.8.1) + websocket-driver (0.7.6) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + zeitwerk (2.6.13) + +PLATFORMS + ruby + +DEPENDENCIES + bootsnap + cypress-rails! + puma + rails (~> 7.1.3) + sqlite3 + webpacker + +BUNDLED WITH + 2.3.13 diff --git a/example/README.md b/example/README.md index 7db80e4..c0738ef 100644 --- a/example/README.md +++ b/example/README.md @@ -1,24 +1,19 @@ # README -This README would normally document whatever steps are necessary to get the -application up and running. - -Things you may want to cover: - -* Ruby version - -* System dependencies - -* Configuration - -* Database creation - -* Database initialization - -* How to run the test suite - -* Services (job queues, cache servers, search engines, etc.) - -* Deployment instructions - -* ... +The example app has multiple, symlinked Gemfiles to be able to test against +different dependency versions (so far just Rails). + +For the latest version of Rails, you can just use all the default `bundle` +commands: +``` +bundle +bundle exec rake cypress:run +``` + +For previous version(s) of Rails, you need to specify the Gemfile to use. So +for `Gemfile_rails71` (which uses Rails 7.1), you'll need to include an env var +when you use `bundle` commands: +``` +BUNDLE_GEMFILE=Gemfile_rails71 bundle +BUNDLE_GEMFILE=Gemfile_rails71 bundle exec rake cypress:run +``` diff --git a/script/test_example_app b/script/test_example_app index 730914e..1a0f673 100755 --- a/script/test_example_app +++ b/script/test_example_app @@ -2,20 +2,27 @@ set -e -directory=$1 +run_example_tests() { + bundle + yarn install -cd example -bundle -yarn install + # test a normal test run + bundle exec rake db:test:prepare + NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=test bundle exec rake assets:precompile + bundle exec rake cypress:run + + # test that passing options works (by printing help) + if ! bundle exec rake cypress:run CYPRESS_RAILS_CYPRESS_OPTS="-h" | grep -q "Usage: cypress run \[options\]"; then + echo "Failed to pass options to cypress run" + exit 1 + fi +} -# test a normal test run -bundle exec rake db:test:prepare -NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=test bundle exec rake assets:precompile -bundle exec rake cypress:run -# test that passing options works (by printing help) -if ! bundle exec rake cypress:run CYPRESS_RAILS_CYPRESS_OPTS="-h" | grep -q "Usage: cypress run \[options\]"; then - echo "Failed to pass options to cypress run" - exit 1 -fi +cd example + +echo "---> Running example tests with default Gemfile" +run_example_tests +echo "---> Running example tests with Gemfile.rails71" +BUNDLE_GEMFILE=Gemfile.rails71 run_example_tests From 497d90d1d73fb1adb3d6ba66d64b5f3037cc6ae3 Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 20 Sep 2024 23:24:31 -0400 Subject: [PATCH 4/6] Don't run Rails 7.2 on Ruby 3.0 --- .github/workflows/main.yml | 7 ++++++- script/test | 2 +- script/test_example_app | 36 +++++++++++++----------------------- 3 files changed, 20 insertions(+), 25 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a1227fc..2732da1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,6 +9,11 @@ jobs: strategy: matrix: ruby-version: ['3.0', '3.3'] + gemfile: ['Gemfile', 'Gemfile_rails71'] + exclude: + # Rails 7.2 requires Ruby 3.1+ + - ruby-version: '3.0' + gemfile: 'Gemfile' steps: - uses: actions/checkout@v4 @@ -18,4 +23,4 @@ jobs: bundler-cache: true - name: Run tests - run: ./script/test + run: ./script/test ${{matrix.gemfile}} diff --git a/script/test b/script/test index cc27cf4..a31d134 100755 --- a/script/test +++ b/script/test @@ -13,7 +13,7 @@ cd .. echo "---> Running tests" bundle exec rake -./script/test_example_app +BUNDLE_GEMFILE="${1-Gemfile}" ./script/test_example_app bundle exec rake test diff --git a/script/test_example_app b/script/test_example_app index 1a0f673..eebbf21 100755 --- a/script/test_example_app +++ b/script/test_example_app @@ -2,27 +2,17 @@ set -e -run_example_tests() { - bundle - yarn install - - # test a normal test run - bundle exec rake db:test:prepare - NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=test bundle exec rake assets:precompile - bundle exec rake cypress:run - - # test that passing options works (by printing help) - if ! bundle exec rake cypress:run CYPRESS_RAILS_CYPRESS_OPTS="-h" | grep -q "Usage: cypress run \[options\]"; then - echo "Failed to pass options to cypress run" - exit 1 - fi -} - - cd example - -echo "---> Running example tests with default Gemfile" -run_example_tests - -echo "---> Running example tests with Gemfile.rails71" -BUNDLE_GEMFILE=Gemfile.rails71 run_example_tests +bundle +yarn install + +# test a normal test run +bundle exec rake db:test:prepare +NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=test bundle exec rake assets:precompile +bundle exec rake cypress:run + +# test that passing options works (by printing help) +if ! bundle exec rake cypress:run CYPRESS_RAILS_CYPRESS_OPTS="-h" | grep -q "Usage: cypress run \[options\]"; then + echo "Failed to pass options to cypress run" + exit 1 +fi From 312bc920c9261a81eaa978f2e77f48a2742735d1 Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 20 Sep 2024 23:26:19 -0400 Subject: [PATCH 5/6] Don't install example dependencies until we need to This prevents us from installing gems in the example app that aren't needed by a different gemfile. --- script/test | 4 ---- 1 file changed, 4 deletions(-) diff --git a/script/test b/script/test index a31d134..ec1db5d 100755 --- a/script/test +++ b/script/test @@ -6,10 +6,6 @@ set -x echo "---> Installing dependencies" bundle -cd example -bundle -yarn -cd .. echo "---> Running tests" bundle exec rake From bf27fcd2ca6ed93d0ab1c98b349c1d341d18f482 Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Tue, 24 Sep 2024 22:41:52 -0400 Subject: [PATCH 6/6] Bump version to 0.8.0.rc1 --- CHANGELOG.md | 3 +++ Gemfile.lock | 2 +- example/Gemfile.lock | 2 +- example/Gemfile_rails71.lock | 2 +- lib/cypress-rails/version.rb | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 286116c..31f71ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +## 0.8.0.rc1 +* Add compatibility with Rails 7.2 + ## 0.7.1 * Add Rack 3.1 support [#163](https://github.com/testdouble/cypress-rails/pull/163) diff --git a/Gemfile.lock b/Gemfile.lock index e3d95e2..eb56460 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - cypress-rails (0.7.1) + cypress-rails (0.8.0.rc1) puma (>= 3.8.0) railties (>= 5.2.0) diff --git a/example/Gemfile.lock b/example/Gemfile.lock index b13201e..1d8f417 100644 --- a/example/Gemfile.lock +++ b/example/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - cypress-rails (0.7.1) + cypress-rails (0.8.0.rc1) puma (>= 3.8.0) railties (>= 5.2.0) diff --git a/example/Gemfile_rails71.lock b/example/Gemfile_rails71.lock index 314b2a4..275a55d 100644 --- a/example/Gemfile_rails71.lock +++ b/example/Gemfile_rails71.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - cypress-rails (0.7.1) + cypress-rails (0.8.0.rc1) puma (>= 3.8.0) railties (>= 5.2.0) diff --git a/lib/cypress-rails/version.rb b/lib/cypress-rails/version.rb index 06e5bc8..3d64fd0 100644 --- a/lib/cypress-rails/version.rb +++ b/lib/cypress-rails/version.rb @@ -1,3 +1,3 @@ module CypressRails - VERSION = "0.7.1" + VERSION = "0.8.0.rc1" end