Skip to content

Commit

Permalink
Spec restart: Update Ruby version to 3.3.6, remove dummy models and v…
Browse files Browse the repository at this point in the history
…iews, and add cspell configuration
  • Loading branch information
mnovelo committed Jan 9, 2025
1 parent 2113c12 commit 67ee006
Show file tree
Hide file tree
Showing 182 changed files with 1,705 additions and 5,075 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rspec_mysql_8_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- 7_2
- 8_0
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}${{ matrix.ruby_version == 'jruby' && '_jdbc' || '' }}_mysql.gemfile
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}_mysql.gemfile
CI: true
DATABASE_ENGINE: mysql
RUBY_VERSION: ${{ matrix.ruby_version }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: RSpec PostgreSQL 14
name: RSpec MySQL 8.0 Trilogy Adapter
on:
push:
branches:
Expand All @@ -25,33 +25,26 @@ jobs:
- 7_2
- 8_0
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}${{ matrix.ruby_version == 'jruby' && '_jdbc' || '' }}_postgresql.gemfile
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}_mysql.gemfile
CI: true
DATABASE_ENGINE: postgresql
DATABASE_ENGINE: mysql
DATABASE_ADAPTER: trilogy
RUBY_VERSION: ${{ matrix.ruby_version }}
RAILS_VERSION: ${{ matrix.rails_version }}
services:
postgres:
image: postgres:14-alpine
mysql:
image: mysql:8.0
env:
POSTGRES_PASSWORD: postgres
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: apartment_postgresql_test
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: apartment_mysql_test
options: >-
--health-cmd pg_isready
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
- 3306:3306
steps:
- name: Install PostgreSQL client
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends postgresql-common
echo | sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends postgresql-client-14
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby_version }}
uses: ruby/setup-ruby@v1
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/rspec_pg_15.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ jobs:
- 7_2
- 8_0
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}${{ matrix.ruby_version == 'jruby' && '_jdbc' || '' }}_postgresql.gemfile
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}_postgresql.gemfile
CI: true
DATABASE_ENGINE: postgresql
RUBY_VERSION: ${{ matrix.ruby_version }}
RAILS_VERSION: ${{ matrix.rails_version }}
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_PASSWORD: postgres
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: apartment_postgresql_test
options: >-
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/rspec_pg_16.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ jobs:
- 7_2
- 8_0
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}${{ matrix.ruby_version == 'jruby' && '_jdbc' || '' }}_postgresql.gemfile
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}_postgresql.gemfile
CI: true
DATABASE_ENGINE: postgresql
RUBY_VERSION: ${{ matrix.ruby_version }}
RAILS_VERSION: ${{ matrix.rails_version }}
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_PASSWORD: postgres
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: apartment_postgresql_test
options: >-
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/rspec_pg_17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ jobs:
- 7_2
- 8_0
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}${{ matrix.ruby_version == 'jruby' && '_jdbc' || '' }}_postgresql.gemfile
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}_postgresql.gemfile
CI: true
DATABASE_ENGINE: postgresql
RUBY_VERSION: ${{ matrix.ruby_version }}
RAILS_VERSION: ${{ matrix.rails_version }}
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
services:
postgres:
image: postgres:17-alpine
env:
POSTGRES_PASSWORD: postgres
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: apartment_postgresql_test
options: >-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rspec_sqlite_3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- 7_2
- 8_0
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}${{ matrix.ruby_version == 'jruby' && '_jdbc' || '' }}_sqlite3.gemfile
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}_sqlite3.gemfile
CI: true
DATABASE_ENGINE: sqlite
RUBY_VERSION: ${{ matrix.ruby_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: runner / rubocop
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_7_2_postgresql.gemfile
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_8_0_postgresql.gemfile
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ cookbooks
tmp
spec/dummy/db/*.sqlite3
.DS_Store
coverage
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Metrics/BlockLength:
Exclude:
- spec/**/*.rb

Metrics/MethodLength:
Max: 20

Rails/RakeEnvironment:
Enabled: false

Expand Down
77 changes: 50 additions & 27 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,46 +1,69 @@
# frozen_string_literal: true

appraise 'rails-7-1-postgresql' do
gem 'rails', '~> 7.1.0'
gem 'pg', '~> 1.5'
db_engine = ENV.fetch('DATABASE_ENGINE', 'all')

if %w[all postgresql].include?(db_engine)
appraise 'rails-7-1-postgresql' do
gem 'rails', '~> 7.1.0'
gem 'pg', '~> 1.5'
end
end

appraise 'rails-7-1-mysql' do
gem 'rails', '~> 7.1.0'
gem 'mysql2', '~> 0.5'
if %w[all mysql].include?(db_engine)
appraise 'rails-7-1-mysql' do
gem 'rails', '~> 7.1.0'
gem 'mysql2', '~> 0.5'
gem 'trilogy', '< 3.0'
end
end

appraise 'rails-7-1-sqlite3' do
gem 'rails', '~> 7.1.0'
gem 'sqlite3', '~> 2.1'
if %w[all sqlite].include?(db_engine)
appraise 'rails-7-1-sqlite3' do
gem 'rails', '~> 7.1.0'
gem 'sqlite3', '~> 2.1'
end
end

appraise 'rails-7-2-postgresql' do
gem 'rails', '~> 7.2.0'
gem 'pg', '~> 1.5'
if %w[all postgresql].include?(db_engine)
appraise 'rails-7-2-postgresql' do
gem 'rails', '~> 7.2.0'
gem 'pg', '~> 1.5'
end
end

appraise 'rails-7-2-mysql' do
gem 'rails', '~> 7.2.0'
gem 'mysql2', '~> 0.5'
if %w[all mysql].include?(db_engine)
appraise 'rails-7-2-mysql' do
gem 'rails', '~> 7.2.0'
gem 'mysql2', '~> 0.5'
gem 'trilogy', '< 3.0'
end
end

appraise 'rails-7-2-sqlite3' do
gem 'rails', '~> 7.2.0'
gem 'sqlite3', '~> 2.1'
if %w[all sqlite].include?(db_engine)
appraise 'rails-7-2-sqlite3' do
gem 'rails', '~> 7.2.0'
gem 'sqlite3', '~> 2.1'
end
end

appraise 'rails-8-0-postgresql' do
gem 'rails', '~> 8.0.0'
gem 'pg', '~> 1.5'
if %w[all postgresql].include?(db_engine)
appraise 'rails-8-0-postgresql' do
gem 'rails', '~> 8.0.0'
gem 'pg', '~> 1.5'
end
end

appraise 'rails-8-0-mysql' do
gem 'rails', '~> 8.0.0'
gem 'mysql2', '~> 0.5'
if %w[all mysql].include?(db_engine)
appraise 'rails-8-0-mysql' do
gem 'rails', '~> 8.0.0'
gem 'mysql2', '~> 0.5'
gem 'trilogy', '< 3.0'
end
end

appraise 'rails-8-0-sqlite3' do
gem 'rails', '~> 8.0.0'
gem 'sqlite3', '~> 2.1'
if %w[all sqlite].include?(db_engine)
appraise 'rails-8-0-sqlite3' do
gem 'rails', '~> 8.0.0'
gem 'sqlite3', '~> 2.1'
end
end
45 changes: 29 additions & 16 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,34 @@

source 'http://rubygems.org'

gemspec

gem 'appraisal', '~> 2.3'
gem 'bundler', '< 3.0'
gem 'database_cleaner'
gem 'faker'
gem 'pry', '~> 0.13'
gem 'rake', '< 14.0'
gem 'rspec', '~> 3.10'
gem 'rspec_junit_formatter', '~> 0.4'
gem 'rspec-rails', '>= 6.1.0', '< 8.1'
gem 'rubocop', '~> 1.12'
gem 'rubocop-performance', '~> 1.10'
gem 'rubocop-rails', '~> 2.10'
gem 'rubocop-rake', '~> 0.5'
gem 'rubocop-rspec', '~> 3.1'
gem 'rubocop-thread_safety', '~> 0.4'
gem 'simplecov', require: false

group :test do
gem 'database_cleaner-active_record'

gem 'faker'

gem 'rspec', '~> 3.10'
gem 'rspec_junit_formatter', '~> 0.4'
gem 'rspec-rails', '>= 6.1.0', '< 8.1'

gem 'rubocop', '~> 1.12', require: false
gem 'rubocop-performance', '~> 1.10', require: false
gem 'rubocop-rails', '~> 2.10', require: false
gem 'rubocop-rake', '~> 0.5', require: false
gem 'rubocop-rspec', '~> 3.1', require: false
gem 'rubocop-thread_safety', '~> 0.4', require: false
gem 'simplecov', require: false
end

group :development do
# IRB alternative console
gem 'pry'
# Make pry the default console
gem 'pry-rails'
# adds docs to the pry CLI
gem 'pry-doc'
end

gemspec
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ Please note that our custom logger inherits from `ActiveRecord::LogSubscriber` s

**Example log output:**

<img src="documentation/images/log_example.png">
<img src="docs/images/log_example.png">

```ruby
Apartment.configure do |config|
Expand Down
Loading

0 comments on commit 67ee006

Please sign in to comment.