Skip to content

Commit 7a3ff84

Browse files
committed
fixci: run the specs against SQLite
1 parent e809ea3 commit 7a3ff84

15 files changed

+372
-20
lines changed

.github/workflows/verify.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
run: |
5252
yarn install
5353
54-
- name: Setup test database (Postgres)
54+
- name: Setup test database
5555
env:
5656
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
5757
RAILS_ENV: test
@@ -60,27 +60,36 @@ jobs:
6060
run: |
6161
bin/rails db:setup
6262
63+
- name: Run Rails tests
64+
env:
65+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
66+
MAGLEV_APP_DATABASE_USERNAME: "maglev"
67+
MAGLEV_APP_DATABASE_PASSWORD: "password"
68+
run: bundle exec rspec
69+
6370
- name: Setup test database (SQLite)
6471
env:
6572
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
6673
RAILS_ENV: test
67-
DATABASE_URL: "sqlite3:storage/maglev_test.sqlite3"
74+
USE_SQLITE: 1
6875
run: |
76+
cp spec/dummy/db/schema.rb spec/dummy/db/schema.pg.rb
77+
cp spec/dummy/db/schema.sqlite.rb spec/dummy/db/schema.rb
78+
cp spec/legacy_dummy/db/schema.rb spec/legacy_dummy/db/schema.pg.rb
79+
cp spec/legacy_dummy/db/schema.sqlite.rb spec/legacy_dummy/db/schema.rb
6980
bin/rails db:setup
7081
71-
- name: Run Rails tests (Postgres)
72-
env:
73-
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
74-
MAGLEV_APP_DATABASE_USERNAME: "maglev"
75-
MAGLEV_APP_DATABASE_PASSWORD: "password"
76-
run: bundle exec rspec
77-
7882
- name: Run Rails tests (SQLite)
7983
env:
8084
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
81-
DATABASE_URL: "sqlite3:storage/maglev_test.sqlite3"
85+
USE_SQLITE: true
8286
run: bundle exec rspec
83-
87+
88+
- name: Cleanup DB schema files
89+
run: |
90+
cp spec/dummy/db/schema.pg.rb spec/dummy/db/schema.rb
91+
cp spec/legacy_dummy/db/schema.pg.rb spec/legacy_dummy/db/schema.rb
92+
8493
- name: Run Javascript tests
8594
run: yarn test
8695

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,7 @@ node_modules
3535
# https://vitejs.dev/guide/env-and-mode.html#env-files
3636

3737
*.local
38-
bin/test
38+
bin/test
39+
40+
spec/dummy/db/*.sqlite3
41+
spec/legacy_dummy/db/*.sqlite3

Gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ gem 'puma'
3030
# To use a debugger
3131
# gem 'byebug', group: [:development, :test]
3232

33+
# Use SQLite/PostgreSQL for development and test
34+
gem 'pg', '~> 1.5.9'
35+
gem 'sqlite3'
36+
37+
# Gems no longer be part of the default gems from Ruby 3.5.0
38+
gem 'observer'
39+
gem 'ostruct'
40+
3341
group :development, :test do
3442
gem 'bcrypt'
3543

Gemfile.lock

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ GEM
184184
racc (~> 1.4)
185185
nokogiri (1.16.7-x86_64-linux)
186186
racc (~> 1.4)
187+
observer (0.1.2)
188+
ostruct (0.6.1)
187189
parallel (1.26.3)
188190
parser (3.3.6.0)
189191
ast (~> 2.4.1)
@@ -309,6 +311,16 @@ GEM
309311
simplecov_json_formatter (~> 0.1)
310312
simplecov-html (0.13.1)
311313
simplecov_json_formatter (0.1.4)
314+
sqlite3 (2.6.0-aarch64-linux-gnu)
315+
sqlite3 (2.6.0-aarch64-linux-musl)
316+
sqlite3 (2.6.0-arm-linux-gnu)
317+
sqlite3 (2.6.0-arm-linux-musl)
318+
sqlite3 (2.6.0-arm64-darwin)
319+
sqlite3 (2.6.0-x86-linux-gnu)
320+
sqlite3 (2.6.0-x86-linux-musl)
321+
sqlite3 (2.6.0-x86_64-darwin)
322+
sqlite3 (2.6.0-x86_64-linux-gnu)
323+
sqlite3 (2.6.0-x86_64-linux-musl)
312324
stringio (3.1.2)
313325
thor (1.3.2)
314326
timeout (0.4.2)
@@ -355,6 +367,8 @@ DEPENDENCIES
355367
image_processing (~> 1.12.2)
356368
maglevcms!
357369
nokogiri (>= 1.15.6)
370+
observer
371+
ostruct
358372
pg (~> 1.5.9)
359373
propshaft
360374
puma
@@ -365,6 +379,7 @@ DEPENDENCIES
365379
rubocop-rails_config
366380
rubocop-rspec
367381
simplecov
382+
sqlite3
368383

369384
BUNDLED WITH
370385
2.5.7

Gemfile.rails_6

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ gem 'puma'
3333
# To use a debugger
3434
# gem 'byebug', group: [:development, :test]
3535

36+
# Use SQLite/PostgreSQL for development and test
37+
gem 'pg', '~> 1.5.9'
38+
gem 'sqlite3'
39+
40+
# Gems no longer be part of the default gems from Ruby 3.5.0
41+
gem 'observer'
42+
gem 'ostruct'
43+
gem 'base64'
44+
gem 'bigdecimal'
45+
gem 'mutex_m'
46+
gem 'drb'
47+
3648
group :development, :test do
3749
# Use SCSS for stylesheets
3850
gem 'bcrypt'

Gemfile.rails_6.lock

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,16 @@ GEM
7272
tzinfo (~> 2.0)
7373
zeitwerk (~> 2.3)
7474
ast (2.4.2)
75+
base64 (0.2.0)
7576
bcrypt (3.1.20)
77+
bigdecimal (3.1.9)
7678
builder (3.3.0)
7779
concurrent-ruby (1.3.4)
7880
crass (1.0.6)
7981
date (3.4.0)
8082
diff-lcs (1.5.1)
8183
docile (1.4.1)
84+
drb (2.2.1)
8285
dry-cli (1.2.0)
8386
erubi (1.13.0)
8487
factory_bot (6.2.1)
@@ -134,6 +137,7 @@ GEM
134137
mini_magick (4.13.2)
135138
mini_mime (1.1.5)
136139
minitest (5.25.1)
140+
mutex_m (0.3.0)
137141
net-imap (0.5.1)
138142
date
139143
net-protocol
@@ -156,6 +160,8 @@ GEM
156160
racc (~> 1.4)
157161
nokogiri (1.16.7-x86_64-linux)
158162
racc (~> 1.4)
163+
observer (0.1.2)
164+
ostruct (0.6.1)
159165
parallel (1.26.3)
160166
parser (3.3.6.0)
161167
ast (~> 2.4.1)
@@ -271,6 +277,12 @@ GEM
271277
actionpack (>= 6.1)
272278
activesupport (>= 6.1)
273279
sprockets (>= 3.0.0)
280+
sqlite3 (2.6.0-aarch64-linux-gnu)
281+
sqlite3 (2.6.0-arm-linux-gnu)
282+
sqlite3 (2.6.0-arm64-darwin)
283+
sqlite3 (2.6.0-x86-linux-gnu)
284+
sqlite3 (2.6.0-x86_64-darwin)
285+
sqlite3 (2.6.0-x86_64-linux-gnu)
274286
thor (1.3.2)
275287
timeout (0.4.2)
276288
tzinfo (2.0.6)
@@ -298,13 +310,19 @@ PLATFORMS
298310
x86_64-linux
299311

300312
DEPENDENCIES
313+
base64
301314
bcrypt
315+
bigdecimal
316+
drb
302317
factory_bot_rails (~> 6.2.0)
303318
generator_spec
304319
image_processing (~> 1.12.2)
305320
maglevcms!
306321
mini_magick (~> 4.11)
322+
mutex_m
307323
nokogiri (>= 1.13.10)
324+
observer
325+
ostruct
308326
pg (~> 1.5.9)
309327
puma
310328
rails (~> 6.1)
@@ -314,6 +332,7 @@ DEPENDENCIES
314332
rubocop-rspec
315333
simplecov
316334
sprockets-rails
335+
sqlite3
317336

318337
BUNDLED WITH
319338
2.5.4

Gemfile.rails_7_0

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ gem 'puma'
3333
# To use a debugger
3434
# gem 'byebug', group: [:development, :test]
3535

36+
# Use SQLite/PostgreSQL for development and test
37+
gem 'pg', '~> 1.5.9'
38+
gem 'sqlite3'
39+
40+
# Gems no longer be part of the default gems from Ruby 3.5.0
41+
gem 'observer'
42+
gem 'ostruct'
43+
gem 'base64'
44+
gem 'bigdecimal'
45+
gem 'mutex_m'
46+
gem 'drb'
47+
3648
group :development, :test do
3749
# Use SCSS for stylesheets
3850
gem 'bcrypt'

Gemfile.rails_7_0.lock

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,16 @@ GEM
7878
minitest (>= 5.1)
7979
tzinfo (~> 2.0)
8080
ast (2.4.2)
81+
base64 (0.2.0)
8182
bcrypt (3.1.20)
83+
bigdecimal (3.1.9)
8284
builder (3.3.0)
8385
concurrent-ruby (1.3.4)
8486
crass (1.0.6)
8587
date (3.4.0)
8688
diff-lcs (1.5.1)
8789
docile (1.4.1)
90+
drb (2.2.1)
8891
dry-cli (1.2.0)
8992
erubi (1.13.0)
9093
factory_bot (6.2.1)
@@ -140,6 +143,7 @@ GEM
140143
mini_magick (4.13.2)
141144
mini_mime (1.1.5)
142145
minitest (5.25.1)
146+
mutex_m (0.3.0)
143147
net-imap (0.5.1)
144148
date
145149
net-protocol
@@ -162,6 +166,8 @@ GEM
162166
racc (~> 1.4)
163167
nokogiri (1.16.7-x86_64-linux)
164168
racc (~> 1.4)
169+
observer (0.1.2)
170+
ostruct (0.6.1)
165171
parallel (1.26.3)
166172
parser (3.3.6.0)
167173
ast (~> 2.4.1)
@@ -277,6 +283,12 @@ GEM
277283
actionpack (>= 6.1)
278284
activesupport (>= 6.1)
279285
sprockets (>= 3.0.0)
286+
sqlite3 (2.6.0-aarch64-linux-gnu)
287+
sqlite3 (2.6.0-arm-linux-gnu)
288+
sqlite3 (2.6.0-arm64-darwin)
289+
sqlite3 (2.6.0-x86-linux-gnu)
290+
sqlite3 (2.6.0-x86_64-darwin)
291+
sqlite3 (2.6.0-x86_64-linux-gnu)
280292
thor (1.3.2)
281293
timeout (0.4.2)
282294
tzinfo (2.0.6)
@@ -304,13 +316,19 @@ PLATFORMS
304316
x86_64-linux
305317

306318
DEPENDENCIES
319+
base64
307320
bcrypt
321+
bigdecimal
322+
drb
308323
factory_bot_rails (~> 6.2.0)
309324
generator_spec
310325
image_processing (~> 1.12.2)
311326
maglevcms!
312327
mini_magick (~> 4.11)
328+
mutex_m
313329
nokogiri (>= 1.13.10)
330+
observer
331+
ostruct
314332
pg (~> 1.5.9)
315333
puma
316334
rails (= 7.0.8)
@@ -320,6 +338,7 @@ DEPENDENCIES
320338
rubocop-rspec
321339
simplecov
322340
sprockets-rails
341+
sqlite3
323342

324343
BUNDLED WITH
325344
2.5.4

Gemfile.rails_7_2

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ gem 'puma'
3636
# To use a debugger
3737
# gem 'byebug', group: [:development, :test]
3838

39+
# Use SQLite/PostgreSQL for development and test
40+
gem 'pg', '~> 1.5.9'
41+
gem 'sqlite3'
42+
43+
# Gems no longer be part of the default gems from Ruby 3.5.0
44+
gem 'observer'
45+
gem 'ostruct'
46+
3947
group :development, :test do
4048
# Use SCSS for stylesheets
4149
gem 'bcrypt'

Gemfile.rails_7_2.lock

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ GEM
184184
racc (~> 1.4)
185185
nokogiri (1.16.7-x86_64-linux)
186186
racc (~> 1.4)
187+
observer (0.1.2)
188+
ostruct (0.6.1)
187189
parallel (1.26.3)
188190
parser (3.3.6.0)
189191
ast (~> 2.4.1)
@@ -312,6 +314,16 @@ GEM
312314
actionpack (>= 6.1)
313315
activesupport (>= 6.1)
314316
sprockets (>= 3.0.0)
317+
sqlite3 (2.6.0-aarch64-linux-gnu)
318+
sqlite3 (2.6.0-aarch64-linux-musl)
319+
sqlite3 (2.6.0-arm-linux-gnu)
320+
sqlite3 (2.6.0-arm-linux-musl)
321+
sqlite3 (2.6.0-arm64-darwin)
322+
sqlite3 (2.6.0-x86-linux-gnu)
323+
sqlite3 (2.6.0-x86-linux-musl)
324+
sqlite3 (2.6.0-x86_64-darwin)
325+
sqlite3 (2.6.0-x86_64-linux-gnu)
326+
sqlite3 (2.6.0-x86_64-linux-musl)
315327
stringio (3.1.2)
316328
thor (1.3.2)
317329
timeout (0.4.2)
@@ -357,6 +369,8 @@ DEPENDENCIES
357369
image_processing (~> 1.12.2)
358370
maglevcms!
359371
nokogiri (>= 1.15.6)
372+
observer
373+
ostruct
360374
pg (~> 1.5.9)
361375
puma
362376
rack (~> 3.0.10)
@@ -369,6 +383,7 @@ DEPENDENCIES
369383
rubocop-rspec
370384
simplecov
371385
sprockets-rails
386+
sqlite3
372387

373388
BUNDLED WITH
374389
2.5.7

maglevcms.gemspec

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,5 @@ Gem::Specification.new do |spec|
5151
spec.add_dependency 'rails', '< 9', '>= 6'
5252
spec.add_dependency 'vite_rails', '< 4', '>= 3'
5353
spec.add_dependency 'vite_ruby', '>= 3.5'
54-
55-
spec.add_development_dependency 'pg', '~> 1.5.9'
5654
end
5755
# rubocop:enable Metrics/BlockLength

0 commit comments

Comments
 (0)