cypress-rails 0.7.0 → 0.8.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b5037ac29bfc53baf2b770242635353028792d2577b8468d848973272da2f76
4
- data.tar.gz: 38da1e00388f74e87cd54ffd8e74ace953fc1ee2f69d231e83dd00a02eb04935
3
+ metadata.gz: 340bff5215842cc3afb419ff29bef8b977e573fdf5311711b4d0badaa05104d1
4
+ data.tar.gz: c720c43244302da09c9f63f416cba150926c0a6ef4cbf53bc2c418727dd3b87a
5
5
  SHA512:
6
- metadata.gz: f6ba80e9f20f20bbac8a861f4f27cd5279a6d9b658a2331e9e10ccc8d4d8dbb425c18140ebebfd3f12fe314cb21678ce9b18be8d18aa16e54778b483eef66ee6
7
- data.tar.gz: 465bd36d2bf6f42ee12c17bdeb38c465ad84168c98f984bfb1c050d1843b8c45305615a4c6c3f82b929a86281f2febbffab0905cd65b7c6456ae3184d52952de
6
+ metadata.gz: bfb0b42e92ad4e5b576264b18ba035964823cc32b3717979edd127ca14b17f14639cf14083390c27daa1740b0302c0ba9c8b1ba53bb531ca72a03bdd9e9e0798
7
+ data.tar.gz: 78f57627a4eec8c0ccde58b24b1e6104fe8164e11375a46561a5cf8fbcce12a9536041e60c7be431a7c389a00b3132db679a13b93f49810069e8a6271f255864
@@ -8,14 +8,19 @@ jobs:
8
8
 
9
9
  strategy:
10
10
  matrix:
11
- ruby-version: ['2.7', '3.0']
11
+ ruby-version: ['3.0', '3.3']
12
+ gemfile: ['Gemfile', 'Gemfile_rails71']
13
+ exclude:
14
+ # Rails 7.2 requires Ruby 3.1+
15
+ - ruby-version: '3.0'
16
+ gemfile: 'Gemfile'
12
17
 
13
18
  steps:
14
- - uses: actions/checkout@v2
19
+ - uses: actions/checkout@v4
15
20
  - uses: ruby/setup-ruby@v1
16
21
  with:
17
22
  ruby-version: ${{ matrix.ruby-version }}
18
23
  bundler-cache: true
19
24
 
20
25
  - name: Run tests
21
- run: ./script/test
26
+ run: ./script/test ${{matrix.gemfile}}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.8.0.rc1
4
+ * Add compatibility with Rails 7.2
5
+
6
+ ## 0.7.1
7
+ * Add Rack 3.1 support [#163](https://github.com/testdouble/cypress-rails/pull/163)
8
+
3
9
  ## 0.7.0
4
10
  git
5
11
  * Add a `CYPRESS_RAILS_CYPRESS_DIR` option for cases where
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cypress-rails (0.7.0)
4
+ cypress-rails (0.8.0.rc1)
5
5
  puma (>= 3.8.0)
6
6
  railties (>= 5.2.0)
7
7
 
@@ -47,28 +47,30 @@ GEM
47
47
  i18n (1.14.1)
48
48
  concurrent-ruby (~> 1.0)
49
49
  io-console (0.7.2)
50
- irb (1.11.2)
51
- rdoc
50
+ irb (1.13.1)
51
+ rdoc (>= 4.0.0)
52
52
  reline (>= 0.4.2)
53
+ json (2.7.1)
54
+ language_server-protocol (3.17.0.3)
55
+ lint_roller (1.1.0)
53
56
  loofah (2.22.0)
54
57
  crass (~> 1.0.2)
55
58
  nokogiri (>= 1.12.0)
56
- mini_portile2 (2.8.5)
57
- minitest (5.15.0)
59
+ minitest (5.22.2)
58
60
  mutex_m (0.2.0)
59
61
  nio4r (2.7.0)
60
62
  nokogiri (1.16.2)
61
- mini_portile2 (~> 2.8.2)
62
63
  racc (~> 1.4)
63
- parallel (1.22.1)
64
- parser (3.1.2.0)
64
+ parallel (1.24.0)
65
+ parser (3.3.0.5)
65
66
  ast (~> 2.4.1)
67
+ racc
66
68
  psych (5.1.2)
67
69
  stringio
68
70
  puma (6.4.2)
69
71
  nio4r (~> 2.0)
70
72
  racc (1.7.3)
71
- rack (3.0.9)
73
+ rack (3.1.7)
72
74
  rack-session (2.0.0)
73
75
  rack (>= 3.0.0)
74
76
  rack-test (2.1.0)
@@ -92,37 +94,48 @@ GEM
92
94
  thor (~> 1.0, >= 1.2.2)
93
95
  zeitwerk (~> 2.6)
94
96
  rainbow (3.1.1)
95
- rake (13.0.6)
96
- rdoc (6.6.2)
97
+ rake (13.1.0)
98
+ rdoc (6.6.3.1)
97
99
  psych (>= 4.0.0)
98
- regexp_parser (2.4.0)
99
- reline (0.4.2)
100
+ regexp_parser (2.9.0)
101
+ reline (0.5.7)
100
102
  io-console (~> 0.5)
101
- rexml (3.2.5)
102
- rubocop (1.29.1)
103
+ rexml (3.2.6)
104
+ rubocop (1.59.0)
105
+ json (~> 2.3)
106
+ language_server-protocol (>= 3.17.0)
103
107
  parallel (~> 1.10)
104
- parser (>= 3.1.0.0)
108
+ parser (>= 3.2.2.4)
105
109
  rainbow (>= 2.2.2, < 4.0)
106
110
  regexp_parser (>= 1.8, < 3.0)
107
111
  rexml (>= 3.2.5, < 4.0)
108
- rubocop-ast (>= 1.17.0, < 2.0)
112
+ rubocop-ast (>= 1.30.0, < 2.0)
109
113
  ruby-progressbar (~> 1.7)
110
- unicode-display_width (>= 1.4.0, < 3.0)
111
- rubocop-ast (1.18.0)
112
- parser (>= 3.1.1.0)
113
- rubocop-performance (1.13.3)
114
- rubocop (>= 1.7.0, < 2.0)
115
- rubocop-ast (>= 0.4.0)
116
- ruby-progressbar (1.11.0)
114
+ unicode-display_width (>= 2.4.0, < 3.0)
115
+ rubocop-ast (1.30.0)
116
+ parser (>= 3.2.1.0)
117
+ rubocop-performance (1.20.2)
118
+ rubocop (>= 1.48.1, < 2.0)
119
+ rubocop-ast (>= 1.30.0, < 2.0)
120
+ ruby-progressbar (1.13.0)
117
121
  ruby2_keywords (0.0.5)
118
- standard (1.12.1)
119
- rubocop (= 1.29.1)
120
- rubocop-performance (= 1.13.3)
121
- stringio (3.1.0)
122
+ standard (1.33.0)
123
+ language_server-protocol (~> 3.17.0.2)
124
+ lint_roller (~> 1.0)
125
+ rubocop (~> 1.59.0)
126
+ standard-custom (~> 1.0.0)
127
+ standard-performance (~> 1.3)
128
+ standard-custom (1.0.2)
129
+ lint_roller (~> 1.0)
130
+ rubocop (~> 1.50)
131
+ standard-performance (1.3.1)
132
+ lint_roller (~> 1.1)
133
+ rubocop-performance (~> 1.20.2)
134
+ stringio (3.1.1)
122
135
  thor (1.3.0)
123
136
  tzinfo (2.0.6)
124
137
  concurrent-ruby (~> 1.0)
125
- unicode-display_width (2.1.0)
138
+ unicode-display_width (2.5.0)
126
139
  webrick (1.8.1)
127
140
  zeitwerk (2.6.13)
128
141
 
@@ -14,7 +14,7 @@ module CypressRails
14
14
  end
15
15
 
16
16
  def call(command, config)
17
- puts config.to_s
17
+ puts config
18
18
  @initializer_hooks.run(:before_server_start)
19
19
  if config.transactional_server
20
20
  @manages_transactions.begin_transaction
@@ -10,7 +10,6 @@ module CypressRails
10
10
  @connections = gather_connections
11
11
  @connections.each do |connection|
12
12
  connection.begin_transaction joinable: false, _lazy: false
13
- connection.pool.lock_thread = true
14
13
  end
15
14
 
16
15
  # When connections are established in the future, begin a transaction too
@@ -26,7 +25,6 @@ module CypressRails
26
25
 
27
26
  if connection && !@connections.include?(connection)
28
27
  connection.begin_transaction joinable: false, _lazy: false
29
- connection.pool.lock_thread = true
30
28
  @connections << connection
31
29
  end
32
30
  end
@@ -42,7 +40,6 @@ module CypressRails
42
40
 
43
41
  @connections.each do |connection|
44
42
  connection.rollback_transaction if connection.transaction_open?
45
- connection.pool.lock_thread = false
46
43
  end
47
44
  @connections.clear
48
45
 
@@ -58,7 +55,14 @@ module CypressRails
58
55
  def gather_connections
59
56
  setup_shared_connection_pool
60
57
 
61
- ActiveRecord::Base.connection_handler.connection_pool_list.map(&:connection)
58
+ ActiveRecord::Base.connection_handler.connection_pool_list.map do |pool|
59
+ # Rails 7.2+
60
+ if pool.respond_to?(:lease_connection)
61
+ pool.lease_connection
62
+ else
63
+ pool.connection
64
+ end
65
+ end
62
66
  end
63
67
 
64
68
  # Shares the writing connection pool with connections on
@@ -10,7 +10,8 @@ module CypressRails
10
10
  default_options = {Host: host, Port: port, Threads: "0:4", workers: 0, daemon: false}
11
11
  options = default_options # .merge(options)
12
12
 
13
- conf = Rack::Handler::Puma.config(app, options)
13
+ puma_rack_handler = defined?(Rackup::Handler::Puma) ? Rackup::Handler::Puma : Rack::Handler::Puma
14
+ conf = puma_rack_handler.config(app, options)
14
15
  conf.clamp
15
16
  logger = (defined?(::Puma::LogWriter) ? ::Puma::LogWriter : ::Puma::Events).stdio
16
17
 
@@ -53,7 +53,7 @@ module CypressRails
53
53
 
54
54
  res = @checker.request { |http| http.get("/__identify__") }
55
55
 
56
- return res.body == app.object_id.to_s if res.is_a?(Net::HTTPSuccess) || res.is_a?(Net::HTTPRedirection)
56
+ res.body == app.object_id.to_s if res.is_a?(Net::HTTPSuccess) || res.is_a?(Net::HTTPRedirection)
57
57
  rescue SystemCallError, Net::ReadTimeout, OpenSSL::SSL::SSLError
58
58
  false
59
59
  end
@@ -1,3 +1,3 @@
1
1
  module CypressRails
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0.rc1"
3
3
  end
data/script/test CHANGED
@@ -6,14 +6,10 @@ set -x
6
6
 
7
7
  echo "---> Installing dependencies"
8
8
  bundle
9
- cd example
10
- bundle
11
- yarn
12
- cd ..
13
9
 
14
10
  echo "---> Running tests"
15
11
  bundle exec rake
16
- ./script/test_example_app
12
+ BUNDLE_GEMFILE="${1-Gemfile}" ./script/test_example_app
17
13
 
18
14
  bundle exec rake test
19
15
 
@@ -2,8 +2,6 @@
2
2
 
3
3
  set -e
4
4
 
5
- directory=$1
6
-
7
5
  cd example
8
6
  bundle
9
7
  yarn install
@@ -18,4 +16,3 @@ if ! bundle exec rake cypress:run CYPRESS_RAILS_CYPRESS_OPTS="-h" | grep -q "Usa
18
16
  echo "Failed to pass options to cypress run"
19
17
  exit 1
20
18
  fi
21
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cypress-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-13 00:00:00.000000000 Z
11
+ date: 2024-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  - !ruby/object:Gem::Version
160
160
  version: '0'
161
161
  requirements: []
162
- rubygems_version: 3.5.4
162
+ rubygems_version: 3.5.11
163
163
  signing_key:
164
164
  specification_version: 4
165
165
  summary: Helps you write Cypress tests of your Rails app