Skip to content

Commit e7fe175

Browse files
Revert "FYST-2136 switch test runner to rspec & use postgresql as well (#26)" (#34)
1 parent 639c338 commit e7fe175

18 files changed

Lines changed: 67 additions & 226 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ name: Run Linter and Tests
22

33
on:
44
pull_request:
5-
workflow_call:
65
push:
76
branches: [ main ]
8-
workflow_dispatch:
7+
workflow_call:
98

109
jobs:
1110
scan_ruby:
@@ -58,22 +57,15 @@ jobs:
5857
test:
5958
runs-on: ubuntu-latest
6059

61-
services:
62-
postgres:
63-
image: postgres
64-
env:
65-
RAILS_ENV: test
66-
POSTGRES_USER: postgres
67-
POSTGRES_PASSWORD: postgres
68-
ports:
69-
- 5432:5432
70-
options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
71-
60+
# services:
61+
# redis:
62+
# image: redis
63+
# ports:
64+
# - 6379:6379
65+
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
7266
steps:
7367
- name: Install packages
74-
run: |
75-
sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git libpq-dev libyaml-dev node-gyp pkg-config python-is-python3 google-chrome-stable
76-
sudo apt-get install -y libpq-dev
68+
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git libyaml-dev pkg-config google-chrome-stable
7769

7870
- name: Checkout code
7971
uses: actions/checkout@v4
@@ -87,5 +79,13 @@ jobs:
8779
- name: Run tests
8880
env:
8981
RAILS_ENV: test
90-
DATABASE_URL: postgres://postgres:postgres@localhost:5432
91-
run: RAILS_ENV=test bin/rails db:test:prepare spec
82+
# REDIS_URL: redis://localhost:6379/0
83+
run: bin/rails db:test:prepare test test:system
84+
85+
- name: Keep screenshots from failed system tests
86+
uses: actions/upload-artifact@v4
87+
if: failure()
88+
with:
89+
name: screenshots
90+
path: ${{ github.workspace }}/tmp/screenshots
91+
if-no-files-found: ignore

.rspec

Lines changed: 0 additions & 1 deletion
This file was deleted.

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ source "https://rubygems.org"
44
gem "rails", "~> 8.0.2"
55
# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
66
gem "propshaft"
7-
gem "pg"
7+
# Use sqlite3 as the database for Active Record
8+
gem "sqlite3", ">= 2.1"
89
# Use the Puma web server [https://github.com/puma/puma]
910
gem "puma", ">= 5.0"
1011
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
@@ -49,7 +50,6 @@ group :development, :test do
4950

5051
# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
5152
gem "rubocop-rails-omakase", require: false
52-
gem "rspec-rails"
5353
end
5454

5555
group :development do

Gemfile.lock

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ GEM
122122
debug (1.10.0)
123123
irb (~> 1.10)
124124
reline (>= 0.3.8)
125-
diff-lcs (1.6.2)
126125
dotenv (3.1.8)
127126
drb (2.2.3)
128127
ed25519 (1.4.0)
@@ -247,7 +246,6 @@ GEM
247246
parser (3.3.8.0)
248247
ast (~> 2.4.1)
249248
racc
250-
pg (1.5.9)
251249
pp (0.6.2)
252250
prettyprint
253251
prettyprint (0.2.0)
@@ -314,23 +312,6 @@ GEM
314312
reline (0.6.1)
315313
io-console (~> 0.5)
316314
rexml (3.4.1)
317-
rspec-core (3.13.4)
318-
rspec-support (~> 3.13.0)
319-
rspec-expectations (3.13.5)
320-
diff-lcs (>= 1.2.0, < 2.0)
321-
rspec-support (~> 3.13.0)
322-
rspec-mocks (3.13.5)
323-
diff-lcs (>= 1.2.0, < 2.0)
324-
rspec-support (~> 3.13.0)
325-
rspec-rails (8.0.0)
326-
actionpack (>= 7.2)
327-
activesupport (>= 7.2)
328-
railties (>= 7.2)
329-
rspec-core (~> 3.13)
330-
rspec-expectations (~> 3.13)
331-
rspec-mocks (~> 3.13)
332-
rspec-support (~> 3.13)
333-
rspec-support (3.13.4)
334315
rubocop (1.75.7)
335316
json (~> 2.3)
336317
language_server-protocol (~> 3.17.0.2)
@@ -405,6 +386,14 @@ GEM
405386
fugit (~> 1.11.0)
406387
railties (>= 7.1)
407388
thor (~> 1.3.1)
389+
sqlite3 (2.7.0-aarch64-linux-gnu)
390+
sqlite3 (2.7.0-aarch64-linux-musl)
391+
sqlite3 (2.7.0-arm-linux-gnu)
392+
sqlite3 (2.7.0-arm-linux-musl)
393+
sqlite3 (2.7.0-arm64-darwin)
394+
sqlite3 (2.7.0-x86_64-darwin)
395+
sqlite3 (2.7.0-x86_64-linux-gnu)
396+
sqlite3 (2.7.0-x86_64-linux-musl)
408397
sshkit (1.24.0)
409398
base64
410399
logger
@@ -468,16 +457,15 @@ DEPENDENCIES
468457
importmap-rails
469458
jbuilder
470459
kamal
471-
pg
472460
propshaft
473461
puma (>= 5.0)
474462
rails (~> 8.0.2)
475-
rspec-rails
476463
rubocop-rails-omakase
477464
selenium-webdriver
478465
solid_cable
479466
solid_cache
480467
solid_queue
468+
sqlite3 (>= 2.1)
481469
stimulus-rails
482470
thruster
483471
turbo-rails

config/database.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
1+
# SQLite. Versions 3.8.0 and up are supported.
2+
# gem install sqlite3
3+
#
4+
# Ensure the SQLite 3 gem is defined in your Gemfile
5+
# gem "sqlite3"
6+
#
17
default: &default
2-
adapter: postgresql
3-
encoding: unicode
8+
adapter: sqlite3
49
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
510
timeout: 5000
611

712
development:
813
<<: *default
9-
database: prior_year_access_development
10-
host: localhost
11-
port: 5432
14+
database: storage/development.sqlite3
1215

1316
# Warning: The database defined as "test" will be erased and
1417
# re-generated from your development database when you run "rake".
1518
# Do not set this db to the same as development or production.
1619
test:
1720
<<: *default
18-
database: prior_year_access_test
19-
host: localhost
20-
port: 5432
21+
database: storage/test.sqlite3
22+
2123

2224
# Store production database in the storage/ directory, which by default
2325
# is mounted as a persistent Docker volume in config/deploy.yml.

spec/controllers/pages_controller_spec.rb

Lines changed: 0 additions & 10 deletions
This file was deleted.

spec/rails_helper.rb

Lines changed: 0 additions & 72 deletions
This file was deleted.

spec/spec_helper.rb

Lines changed: 0 additions & 94 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
require "test_helper"
2+
3+
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
4+
driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ]
5+
end

test/controllers/.keep

Whitespace-only changes.

0 commit comments

Comments
 (0)