Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split specs according to db version #292

Merged
merged 60 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
8bce1a9
Split specs according to db version
mnovelo Oct 15, 2024
e416284
DB engine specific db configs
mnovelo Oct 22, 2024
0cd4101
Fix typo
mnovelo Oct 22, 2024
9454bb2
Typo and indentation fixes
mnovelo Oct 22, 2024
a4232ac
Refactor database configuration tasks
mnovelo Oct 22, 2024
9b69e3e
Debug YAML load
mnovelo Oct 22, 2024
f750c9d
Fix file reading and test names
mnovelo Oct 22, 2024
0aa1555
Fix rspec versions, workflow names, and writing db configs
mnovelo Oct 22, 2024
34d33d9
Fix workflow test names
mnovelo Oct 22, 2024
6224825
Fix gemspec
mnovelo Oct 22, 2024
9089a82
Remove no db config
mnovelo Oct 23, 2024
0a0c74f
Including lambda
mnovelo Oct 23, 2024
4cfe5eb
Try no db settings
mnovelo Oct 23, 2024
edecb88
Try excluding
mnovelo Oct 23, 2024
bc25810
Safe operator if db undefined
mnovelo Oct 23, 2024
04e45ee
Use postgres as the default
mnovelo Oct 23, 2024
7ea9789
Update configs
mnovelo Oct 23, 2024
6ef2391
Re-add Appraisal generated Gemfiles
mnovelo Oct 23, 2024
c5d8698
Try more appraisal versions
mnovelo Oct 23, 2024
9aabeb5
Try deleting dummy gemspec to avoid conflicts
mnovelo Oct 23, 2024
7cbaf8b
Don't explicitly require sqlite3
mnovelo Oct 23, 2024
e79da2a
Specify sqlite3 first
mnovelo Oct 23, 2024
8c219ba
Still list sqlite3 as dependency, but Rails specify version
mnovelo Oct 23, 2024
8a0c782
Don't specify a version for the jdbc drivers
mnovelo Oct 23, 2024
d24ab0f
Update sqlite3 configs
mnovelo Oct 23, 2024
d798c80
Update adapter specs and loading
mnovelo Oct 23, 2024
1861d94
Update adapters and specs
mnovelo Oct 23, 2024
b8f1aca
Try without a No DB specification
mnovelo Oct 23, 2024
40638d7
Match symbols
mnovelo Oct 23, 2024
5709a3c
Try to always run specs that don't specify a db engine
mnovelo Oct 23, 2024
2d6c7e5
There is no activerecord-jdbc-adapter ~> 71.0
mnovelo Oct 23, 2024
b1708bb
Fix mysql db config
mnovelo Oct 23, 2024
874f22d
Fix mysql commands
mnovelo Oct 24, 2024
af2608f
Update Rakefile
mnovelo Oct 24, 2024
b8db817
Accommodate 6.1 MigrationContext
mnovelo Oct 24, 2024
65d656a
SchemaMigration context
mnovelo Oct 24, 2024
b0b26e0
Try passing connection in migrate
mnovelo Oct 24, 2024
e0509de
Fix version specification
mnovelo Oct 24, 2024
04de3e4
Use default connection
mnovelo Oct 24, 2024
5b4446c
Remove jruby combos for Rails 7.1 and 7.2
mnovelo Oct 24, 2024
5077989
Add additional postgres versions
mnovelo Oct 24, 2024
aad5dbb
Fix pg naming
mnovelo Oct 24, 2024
3c395cd
Install postgres clients
mnovelo Oct 24, 2024
30185de
Use sudo apt-get
mnovelo Oct 24, 2024
ed77c82
Try adding the Postgres APT repo first
mnovelo Oct 24, 2024
d655344
Update how we get all the client libraries
mnovelo Oct 24, 2024
430b6b9
Update pg_dump install again
mnovelo Oct 24, 2024
c73e93e
Use automated repo config
mnovelo Oct 24, 2024
37c0d6e
Try simulating enter key
mnovelo Oct 24, 2024
7b5acc1
Merge branch 'development' into man/db-version-specs
mnovelo Oct 24, 2024
7bfbf47
Merge branch 'development' into man/db-version-specs
mnovelo Oct 24, 2024
a6a9b75
Debug pg adapter
mnovelo Oct 24, 2024
6fc87a7
Fix prefix for excluded models
mnovelo Oct 24, 2024
190394b
Don't double add prefixes
mnovelo Oct 24, 2024
488d85a
Simplify logic for sequence prefixes
mnovelo Oct 24, 2024
fd4066a
Make changelog legacy
mnovelo Oct 25, 2024
8fe5dbf
Add spec coverage
mnovelo Oct 28, 2024
7fef205
Update README and add CODE_OF_CONDUCT
mnovelo Oct 28, 2024
ff446da
Auto-close stale issues
mnovelo Oct 28, 2024
4bce223
Merge remote-tracking branch 'origin/development' into man/db-version…
mnovelo Oct 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Close Stale Issues

on:
schedule:
- cron: '0 0 * * *' # Runs daily at midnight
workflow_dispatch:

permissions:
contents: write # only for delete-branch option
issues: write
pull-requests: write

jobs:
close-stale-issues:
name: Close Stale Issues
runs-on: ubuntu-latest
steps:
- name: Close stale issues and pull requests
uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.'
stale-pr-message: 'This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.'
days-before-stale: 30
days-before-close: 7
stale-issue-label: 'stale'
exempt-issue-labels: 'pinned,security'
stale-pr-label: 'stale'
exempt-pr-labels: 'work-in-progress'
delete-branch: true
76 changes: 0 additions & 76 deletions .github/workflows/main.yml

This file was deleted.

92 changes: 92 additions & 0 deletions .github/workflows/rspec_mysql_8_0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: RSpec MySQL 8.0
on:
push:
branches:
- development
- main
pull_request:
types: [opened, synchronize, reopened]
release:
types: [published]

jobs:
test:
name: ${{ github.workflow }}, Ruby ${{ matrix.ruby_version }}, Rails ${{ matrix.rails_version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby_version:
- 3.1
- 3.2
- 3.3
- jruby
rails_version:
- 6_1
- 7_0
- 7_1
- 7_2
# - master # versions failing
exclude:
- ruby_version: jruby
rails_version: 7_1
- ruby_version: jruby
rails_version: 7_2
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}${{ matrix.ruby_version == 'jruby' && '_jdbc' || '' }}_mysql.gemfile
CI: true
DATABASE_ENGINE: mysql
RUBY_VERSION: ${{ matrix.ruby_version }}
RAILS_VERSION: ${{ matrix.rails_version }}
services:
mysql:
image: mysql:8.0-alpine
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: apartment_mysql_test
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306
steps:
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- name: Configure config database.yml
run: bundle exec rake db:load_credentials
- name: Database Setup
run: bundle exec rake db:test:prepare
- name: Run tests
id: rspec-tests
timeout-minutes: 20
continue-on-error: true
run: |
mkdir -p ./coverage
bundle exec rspec --format progress \
--format RspecJunitFormatter -o ./coverage/test-results.xml \
--profile
- name: Codecov Upload
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
disable_search: true
env_vars: DATABASE_ENGINE, RUBY_VERSION, RAILS_VERSION
file: ./coverage/coverage.json
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
disable_search: true
env_vars: DATABASE_ENGINE, RUBY_VERSION, RAILS_VERSION
file: ./coverage/test-results.xml
- name: Notify of test failure
if: steps.rspec-tests.outcome == 'failure'
run: exit 1
100 changes: 100 additions & 0 deletions .github/workflows/rspec_pg_14.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: RSpec PostgreSQL 14
on:
push:
branches:
- development
- main
pull_request:
types: [opened, synchronize, reopened]
release:
types: [published]

jobs:
test:
name: ${{ github.workflow }}, Ruby ${{ matrix.ruby_version }}, Rails ${{ matrix.rails_version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby_version:
- 3.1
- 3.2
- 3.3
- jruby
rails_version:
- 6_1
- 7_0
- 7_1
- 7_2
# - master # versions failing
exclude:
- ruby_version: jruby
rails_version: 7_1
- ruby_version: jruby
rails_version: 7_2
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}${{ matrix.ruby_version == 'jruby' && '_jdbc' || '' }}_postgresql.gemfile
CI: true
DATABASE_ENGINE: postgresql
RUBY_VERSION: ${{ matrix.ruby_version }}
RAILS_VERSION: ${{ matrix.rails_version }}
services:
postgres:
image: postgres:14-alpine
env:
POSTGRES_PASSWORD: postgres
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: apartment_postgresql_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
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
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- name: Configure config database.yml
run: bundle exec rake db:load_credentials
- name: Database Setup
run: bundle exec rake db:test:prepare
- name: Run tests
id: rspec-tests
timeout-minutes: 20
continue-on-error: true
run: |
mkdir -p ./coverage
bundle exec rspec --format progress \
--format RspecJunitFormatter -o ./coverage/test-results.xml \
--profile
- name: Codecov Upload
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
disable_search: true
env_vars: DATABASE_ENGINE, RUBY_VERSION, RAILS_VERSION
file: ./coverage/coverage.json
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
disable_search: true
env_vars: DATABASE_ENGINE, RUBY_VERSION, RAILS_VERSION
file: ./coverage/test-results.xml
- name: Notify of test failure
if: steps.rspec-tests.outcome == 'failure'
run: exit 1
Loading
Loading