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 +4 -4
- data/.github/workflows/main.yml +8 -3
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +42 -29
- data/lib/cypress-rails/launches_cypress.rb +1 -1
- data/lib/cypress-rails/manages_transactions.rb +8 -4
- data/lib/cypress-rails/server/puma.rb +2 -1
- data/lib/cypress-rails/server.rb +1 -1
- data/lib/cypress-rails/version.rb +1 -1
- data/script/test +1 -5
- data/script/test_example_app +0 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 340bff5215842cc3afb419ff29bef8b977e573fdf5311711b4d0badaa05104d1
|
4
|
+
data.tar.gz: c720c43244302da09c9f63f416cba150926c0a6ef4cbf53bc2c418727dd3b87a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfb0b42e92ad4e5b576264b18ba035964823cc32b3717979edd127ca14b17f14639cf14083390c27daa1740b0302c0ba9c8b1ba53bb531ca72a03bdd9e9e0798
|
7
|
+
data.tar.gz: 78f57627a4eec8c0ccde58b24b1e6104fe8164e11375a46561a5cf8fbcce12a9536041e60c7be431a7c389a00b3132db679a13b93f49810069e8a6271f255864
|
data/.github/workflows/main.yml
CHANGED
@@ -8,14 +8,19 @@ jobs:
|
|
8
8
|
|
9
9
|
strategy:
|
10
10
|
matrix:
|
11
|
-
ruby-version: ['
|
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@
|
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
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cypress-rails (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.
|
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
|
-
|
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.
|
64
|
-
parser (3.
|
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.
|
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
|
96
|
-
rdoc (6.6.
|
97
|
+
rake (13.1.0)
|
98
|
+
rdoc (6.6.3.1)
|
97
99
|
psych (>= 4.0.0)
|
98
|
-
regexp_parser (2.
|
99
|
-
reline (0.
|
100
|
+
regexp_parser (2.9.0)
|
101
|
+
reline (0.5.7)
|
100
102
|
io-console (~> 0.5)
|
101
|
-
rexml (3.2.
|
102
|
-
rubocop (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.
|
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.
|
112
|
+
rubocop-ast (>= 1.30.0, < 2.0)
|
109
113
|
ruby-progressbar (~> 1.7)
|
110
|
-
unicode-display_width (>=
|
111
|
-
rubocop-ast (1.
|
112
|
-
parser (>= 3.
|
113
|
-
rubocop-performance (1.
|
114
|
-
rubocop (>= 1.
|
115
|
-
rubocop-ast (>=
|
116
|
-
ruby-progressbar (1.
|
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.
|
119
|
-
|
120
|
-
|
121
|
-
|
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.
|
138
|
+
unicode-display_width (2.5.0)
|
126
139
|
webrick (1.8.1)
|
127
140
|
zeitwerk (2.6.13)
|
128
141
|
|
@@ -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
|
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
|
-
|
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
|
|
data/lib/cypress-rails/server.rb
CHANGED
@@ -53,7 +53,7 @@ module CypressRails
|
|
53
53
|
|
54
54
|
res = @checker.request { |http| http.get("/__identify__") }
|
55
55
|
|
56
|
-
|
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
|
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
|
|
data/script/test_example_app
CHANGED
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.
|
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-
|
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.
|
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
|