Skip to content

Commit d3faa24

Browse files
committedJan 24, 2025·
Test all SQ supported Rubies
Updates the ruby test matrix to test the following Rubies: * SQ minimum supported version of Ruby: 3.1.6 - this is the terminal version of Ruby 3.1 which is due to EOL 3/31/25 * First and last version Ruby 3.2: 3.2.0 and 3.2.4 * Every version of Ruby 3.3: 3.3.0 - 3.3.6 * Every version of Ruby 3.4: 3.4.0 - 3.4.1 Updates gemspec to handle a ruby 3.1.6 conditional zeitwerk version requirement. Ruby 3.1.6 requires an older version of zeitwerk. This has a knockon effect of requiring special handling in the Github Action. Finally, updates claimed_execution_test.rb to handle Ruby-3.4.0+
1 parent d82e39c commit d3faa24

File tree

5 files changed

+265
-4
lines changed

5 files changed

+265
-4
lines changed
 

‎.github/workflows/main.yml

+53-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Build
2-
on: [push, pull_request]
2+
on: [ push, pull_request ]
33

44
jobs:
55
rubocop:
@@ -16,14 +16,25 @@ jobs:
1616
- name: Run rubocop
1717
run: |
1818
bundle exec rubocop --parallel
19+
1920
tests:
2021
name: Tests
2122
runs-on: ubuntu-latest
2223
strategy:
2324
fail-fast: false
2425
matrix:
25-
ruby-version: [3.3.5]
26-
database: [mysql, postgres, sqlite]
26+
ruby-version:
27+
- 3.2.0
28+
- 3.2.4
29+
- 3.3.0
30+
- 3.3.1
31+
- 3.3.2
32+
- 3.3.4
33+
- 3.3.5
34+
- 3.3.6
35+
- 3.4.0
36+
- 3.4.1
37+
database: [ mysql, postgres, sqlite ]
2738
services:
2839
mysql:
2940
image: mysql:8.0.31
@@ -53,3 +64,42 @@ jobs:
5364
bin/rails db:setup
5465
- name: Run tests
5566
run: bin/rails test
67+
68+
tests-ruby-3-1-6:
69+
name: Tests Ruby 3.1.6
70+
runs-on: ubuntu-latest
71+
strategy:
72+
matrix:
73+
database: [ mysql, postgres, sqlite ]
74+
services:
75+
mysql:
76+
image: mysql:8.0.31
77+
env:
78+
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
79+
ports:
80+
- 33060:3306
81+
options: --health-cmd "mysql -h localhost -e \"select now()\"" --health-interval 1s --health-timeout 5s --health-retries 30
82+
postgres:
83+
image: postgres:15.1
84+
env:
85+
POSTGRES_HOST_AUTH_METHOD: "trust"
86+
ports:
87+
- 55432:5432
88+
env:
89+
TARGET_DB: ${{ matrix.database }}
90+
steps:
91+
- name: Checkout code
92+
uses: actions/checkout@v4
93+
- name: Setup Ruby and install specific gems for 3.1.6
94+
uses: ruby/setup-ruby@v1
95+
with:
96+
ruby-version: 3.1.6
97+
- name: Install dependencies with specific Gemfile.lock
98+
run: |
99+
cp Gemfile.lock.ruby_3_1_6 Gemfile.lock
100+
bundle install
101+
- name: Setup test database
102+
run: |
103+
bin/rails db:setup
104+
- name: Run tests
105+
run: bin/rails test

‎Gemfile.lock.ruby_3_1_6

+205
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
PATH
2+
remote: .
3+
specs:
4+
solid_queue (1.1.2)
5+
activejob (>= 7.1)
6+
activerecord (>= 7.1)
7+
concurrent-ruby (>= 1.3.1)
8+
fugit (~> 1.11.0)
9+
railties (>= 7.1)
10+
thor (~> 1.3.1)
11+
12+
GEM
13+
remote: https://rubygems.org/
14+
specs:
15+
actionpack (7.1.5.1)
16+
actionview (= 7.1.5.1)
17+
activesupport (= 7.1.5.1)
18+
nokogiri (>= 1.8.5)
19+
racc
20+
rack (>= 2.2.4)
21+
rack-session (>= 1.0.1)
22+
rack-test (>= 0.6.3)
23+
rails-dom-testing (~> 2.2)
24+
rails-html-sanitizer (~> 1.6)
25+
actionview (7.1.5.1)
26+
activesupport (= 7.1.5.1)
27+
builder (~> 3.1)
28+
erubi (~> 1.11)
29+
rails-dom-testing (~> 2.2)
30+
rails-html-sanitizer (~> 1.6)
31+
activejob (7.1.5.1)
32+
activesupport (= 7.1.5.1)
33+
globalid (>= 0.3.6)
34+
activemodel (7.1.5.1)
35+
activesupport (= 7.1.5.1)
36+
activerecord (7.1.5.1)
37+
activemodel (= 7.1.5.1)
38+
activesupport (= 7.1.5.1)
39+
timeout (>= 0.4.0)
40+
activesupport (7.1.5.1)
41+
base64
42+
benchmark (>= 0.3)
43+
bigdecimal
44+
concurrent-ruby (~> 1.0, >= 1.0.2)
45+
connection_pool (>= 2.2.5)
46+
drb
47+
i18n (>= 1.6, < 2)
48+
logger (>= 1.4.2)
49+
minitest (>= 5.1)
50+
mutex_m
51+
securerandom (>= 0.3)
52+
tzinfo (~> 2.0)
53+
ast (2.4.2)
54+
base64 (0.2.0)
55+
benchmark (0.4.0)
56+
bigdecimal (3.1.9)
57+
builder (3.3.0)
58+
concurrent-ruby (1.3.4)
59+
connection_pool (2.4.1)
60+
crass (1.0.6)
61+
date (3.4.1)
62+
debug (1.9.2)
63+
irb (~> 1.10)
64+
reline (>= 0.3.8)
65+
drb (2.2.1)
66+
erubi (1.13.1)
67+
et-orbi (1.2.11)
68+
tzinfo
69+
fugit (1.11.1)
70+
et-orbi (~> 1, >= 1.2.11)
71+
raabro (~> 1.4)
72+
globalid (1.2.1)
73+
activesupport (>= 6.1)
74+
i18n (1.14.6)
75+
concurrent-ruby (~> 1.0)
76+
io-console (0.8.0)
77+
irb (1.14.3)
78+
rdoc (>= 4.0.0)
79+
reline (>= 0.4.2)
80+
json (2.9.1)
81+
language_server-protocol (3.17.0.3)
82+
logger (1.6.2)
83+
loofah (2.23.1)
84+
crass (~> 1.0.2)
85+
nokogiri (>= 1.12.0)
86+
minitest (5.25.4)
87+
mocha (2.1.0)
88+
ruby2_keywords (>= 0.0.5)
89+
mutex_m (0.3.0)
90+
mysql2 (0.5.6)
91+
nio4r (2.7.4)
92+
nokogiri (1.18.0-arm64-darwin)
93+
racc (~> 1.4)
94+
nokogiri (1.18.0-x86_64-darwin)
95+
racc (~> 1.4)
96+
nokogiri (1.18.0-x86_64-linux-gnu)
97+
racc (~> 1.4)
98+
parallel (1.26.3)
99+
parser (3.3.6.0)
100+
ast (~> 2.4.1)
101+
racc
102+
pg (1.5.4)
103+
psych (5.2.2)
104+
date
105+
stringio
106+
puma (6.4.3)
107+
nio4r (~> 2.0)
108+
raabro (1.4.0)
109+
racc (1.8.1)
110+
rack (3.1.8)
111+
rack-session (2.0.0)
112+
rack (>= 3.0.0)
113+
rack-test (2.2.0)
114+
rack (>= 1.3)
115+
rackup (2.2.1)
116+
rack (>= 3)
117+
rails-dom-testing (2.2.0)
118+
activesupport (>= 5.0.0)
119+
minitest
120+
nokogiri (>= 1.6)
121+
rails-html-sanitizer (1.6.2)
122+
loofah (~> 2.21)
123+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
124+
railties (7.1.5.1)
125+
actionpack (= 7.1.5.1)
126+
activesupport (= 7.1.5.1)
127+
irb
128+
rackup (>= 1.0.0)
129+
rake (>= 12.2)
130+
thor (~> 1.0, >= 1.2.2)
131+
zeitwerk (~> 2.6)
132+
rainbow (3.1.1)
133+
rake (13.2.1)
134+
rdoc (6.8.1)
135+
psych (>= 4.0.0)
136+
regexp_parser (2.10.0)
137+
reline (0.6.0)
138+
io-console (~> 0.5)
139+
rubocop (1.69.2)
140+
json (~> 2.3)
141+
language_server-protocol (>= 3.17.0)
142+
parallel (~> 1.10)
143+
parser (>= 3.3.0.2)
144+
rainbow (>= 2.2.2, < 4.0)
145+
regexp_parser (>= 2.9.3, < 3.0)
146+
rubocop-ast (>= 1.36.2, < 2.0)
147+
ruby-progressbar (~> 1.7)
148+
unicode-display_width (>= 2.4.0, < 4.0)
149+
rubocop-ast (1.37.0)
150+
parser (>= 3.3.1.0)
151+
rubocop-minitest (0.36.0)
152+
rubocop (>= 1.61, < 2.0)
153+
rubocop-ast (>= 1.31.1, < 2.0)
154+
rubocop-performance (1.23.0)
155+
rubocop (>= 1.48.1, < 2.0)
156+
rubocop-ast (>= 1.31.1, < 2.0)
157+
rubocop-rails (2.28.0)
158+
activesupport (>= 4.2.0)
159+
rack (>= 1.1)
160+
rubocop (>= 1.52.0, < 2.0)
161+
rubocop-ast (>= 1.31.1, < 2.0)
162+
rubocop-rails-omakase (1.0.0)
163+
rubocop
164+
rubocop-minitest
165+
rubocop-performance
166+
rubocop-rails
167+
ruby-progressbar (1.13.0)
168+
ruby2_keywords (0.0.5)
169+
securerandom (0.4.1)
170+
sqlite3 (1.5.4-arm64-darwin)
171+
sqlite3 (1.5.4-x86_64-darwin)
172+
sqlite3 (1.5.4-x86_64-linux)
173+
stringio (3.1.2)
174+
thor (1.3.2)
175+
timeout (0.4.3)
176+
tzinfo (2.0.6)
177+
concurrent-ruby (~> 1.0)
178+
unicode-display_width (3.1.3)
179+
unicode-emoji (~> 4.0, >= 4.0.4)
180+
unicode-emoji (4.0.4)
181+
zeitwerk (2.6.0)
182+
183+
PLATFORMS
184+
arm64-darwin-22
185+
arm64-darwin-23
186+
arm64-darwin-24
187+
x86_64-darwin-21
188+
x86_64-darwin-23
189+
x86_64-linux
190+
191+
DEPENDENCIES
192+
debug (~> 1.9)
193+
logger
194+
mocha
195+
mysql2
196+
pg
197+
puma
198+
rdoc
199+
rubocop-rails-omakase
200+
solid_queue!
201+
sqlite3
202+
zeitwerk (= 2.6.0)
203+
204+
BUNDLED WITH
205+
2.5.9

‎README.md

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ Solid Queue is configured by default in new Rails 8 applications. But if you're
3838
1. `bundle add solid_queue`
3939
2. `bin/rails solid_queue:install`
4040

41+
(Note: The minimum supported version of Rails is 7.1 and Ruby is 3.1.6.)
42+
4143
This will configure Solid Queue as the production Active Job backend, create the configuration files `config/queue.yml` and `config/recurring.yml`, and create the `db/queue_schema.rb`. It'll also create a `bin/jobs` executable wrapper that you can use to start Solid Queue.
4244

4345
Once you've done that, you will then have to add the configuration for the queue database in `config/database.yml`. If you're using SQLite, it'll look like this:

‎solid_queue.gemspec

+4
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,8 @@ Gem::Specification.new do |spec|
3939
spec.add_development_dependency "rubocop-rails-omakase"
4040
spec.add_development_dependency "rdoc"
4141
spec.add_development_dependency "logger"
42+
43+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.2")
44+
spec.add_development_dependency "zeitwerk", "2.6.0"
45+
end
4246
end

‎test/models/solid_queue/claimed_execution_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class SolidQueue::ClaimedExecutionTest < ActiveSupport::TestCase
3131
assert job.failed?
3232
assert_equal "RuntimeError", job.failed_execution.exception_class
3333
assert_equal "This is a RuntimeError exception", job.failed_execution.message
34-
assert_match /app\/jobs\/raising_job\.rb:\d+:in `perform'/, job.failed_execution.backtrace.first
34+
assert_match /\/app\/jobs\/raising_job\.rb:\d+:in [`'](RaisingJob#)?perform'/, job.failed_execution.backtrace.first
3535

3636
assert_equal @process, claimed_execution.process
3737
end

0 commit comments

Comments
 (0)
Please sign in to comment.