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

More spec refactoring #299

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ jobs:
exempt-issue-labels: 'pinned,security'
stale-pr-label: 'stale'
exempt-pr-labels: 'work-in-progress'
delete-branch: true
delete-branch: true

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
4 changes: 4 additions & 0 deletions .github/workflows/gem-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ jobs:
bundler: latest
- name: Publish to RubyGems
uses: rubygems/release-gem@v1

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
16 changes: 11 additions & 5 deletions .github/workflows/rspec_mysql_8_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,20 @@ jobs:
- 3.3
- jruby
rails_version:
- 6_1
- 7_0
- 7_1
- 7_2
- 8_0
# - master # versions failing
exclude:
- ruby_version: jruby
rails_version: 7_1
- ruby_version: jruby
rails_version: 7_2
- ruby_version: jruby
rails_version: 8_0
- ruby_version: 3.1
rails_version: 8_0
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}${{ matrix.ruby_version == 'jruby' && '_jdbc' || '' }}_mysql.gemfile
CI: true
Expand All @@ -53,7 +57,7 @@ jobs:
- 3306:3306
steps:
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby-version }}
- name: Set up Ruby ${{ matrix.ruby_version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
Expand All @@ -68,9 +72,7 @@ jobs:
continue-on-error: true
run: |
mkdir -p ./coverage
bundle exec rspec --format progress \
--format RspecJunitFormatter -o ./coverage/test-results.xml \
--profile
bundle exec rspec
- name: Codecov Upload
uses: codecov/codecov-action@v4
with:
Expand All @@ -90,3 +92,7 @@ jobs:
- name: Notify of test failure
if: steps.rspec-tests.outcome == 'failure'
run: exit 1

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
19 changes: 12 additions & 7 deletions .github/workflows/rspec_pg_14.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,19 @@ jobs:
- 3.3
- jruby
rails_version:
- 6_1
- 7_0
- 7_1
- 7_2
# - master # versions failing
- 8_0
exclude:
- ruby_version: jruby
rails_version: 7_1
- ruby_version: jruby
rails_version: 7_2
- ruby_version: jruby
rails_version: 8_0
- ruby_version: 3.1
rails_version: 8_0
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}${{ matrix.ruby_version == 'jruby' && '_jdbc' || '' }}_postgresql.gemfile
CI: true
Expand Down Expand Up @@ -61,7 +64,7 @@ jobs:
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 }}
- name: Set up Ruby ${{ matrix.ruby_version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
Expand All @@ -76,9 +79,7 @@ jobs:
continue-on-error: true
run: |
mkdir -p ./coverage
bundle exec rspec --format progress \
--format RspecJunitFormatter -o ./coverage/test-results.xml \
--profile
bundle exec rspec
- name: Codecov Upload
uses: codecov/codecov-action@v4
with:
Expand All @@ -97,4 +98,8 @@ jobs:
file: ./coverage/test-results.xml
- name: Notify of test failure
if: steps.rspec-tests.outcome == 'failure'
run: exit 1
run: exit 1

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
19 changes: 12 additions & 7 deletions .github/workflows/rspec_pg_15.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,19 @@ jobs:
- 3.3
- jruby
rails_version:
- 6_1
- 7_0
- 7_1
- 7_2
# - master # versions failing
- 8_0
exclude:
- ruby_version: jruby
rails_version: 7_1
- ruby_version: jruby
rails_version: 7_2
- ruby_version: jruby
rails_version: 8_0
- ruby_version: 3.1
rails_version: 8_0
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}${{ matrix.ruby_version == 'jruby' && '_jdbc' || '' }}_postgresql.gemfile
CI: true
Expand Down Expand Up @@ -61,7 +64,7 @@ jobs:
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends postgresql-client-15
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby-version }}
- name: Set up Ruby ${{ matrix.ruby_version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
Expand All @@ -76,9 +79,7 @@ jobs:
continue-on-error: true
run: |
mkdir -p ./coverage
bundle exec rspec --format progress \
--format RspecJunitFormatter -o ./coverage/test-results.xml \
--profile
bundle exec rspec
- name: Codecov Upload
uses: codecov/codecov-action@v4
with:
Expand All @@ -97,4 +98,8 @@ jobs:
file: ./coverage/test-results.xml
- name: Notify of test failure
if: steps.rspec-tests.outcome == 'failure'
run: exit 1
run: exit 1

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
19 changes: 12 additions & 7 deletions .github/workflows/rspec_pg_16.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,19 @@ jobs:
- 3.3
- jruby
rails_version:
- 6_1
- 7_0
- 7_1
- 7_2
# - master # versions failing
- 8_0
exclude:
- ruby_version: jruby
rails_version: 7_1
- ruby_version: jruby
rails_version: 7_2
- ruby_version: jruby
rails_version: 8_0
- ruby_version: 3.1
rails_version: 8_0
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}${{ matrix.ruby_version == 'jruby' && '_jdbc' || '' }}_postgresql.gemfile
CI: true
Expand Down Expand Up @@ -61,7 +64,7 @@ jobs:
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends postgresql-client-16
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby-version }}
- name: Set up Ruby ${{ matrix.ruby_version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
Expand All @@ -76,9 +79,7 @@ jobs:
continue-on-error: true
run: |
mkdir -p ./coverage
bundle exec rspec --format progress \
--format RspecJunitFormatter -o ./coverage/test-results.xml \
--profile
bundle exec rspec
- name: Codecov Upload
uses: codecov/codecov-action@v4
with:
Expand All @@ -97,4 +98,8 @@ jobs:
file: ./coverage/test-results.xml
- name: Notify of test failure
if: steps.rspec-tests.outcome == 'failure'
run: exit 1
run: exit 1

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
19 changes: 12 additions & 7 deletions .github/workflows/rspec_pg_17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,19 @@ jobs:
- 3.3
- jruby
rails_version:
- 6_1
- 7_0
- 7_1
- 7_2
# - master # versions failing
- 8_0
exclude:
- ruby_version: jruby
rails_version: 7_1
- ruby_version: jruby
rails_version: 7_2
- ruby_version: jruby
rails_version: 8_0
- ruby_version: 3.1
rails_version: 8_0
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}${{ matrix.ruby_version == 'jruby' && '_jdbc' || '' }}_postgresql.gemfile
CI: true
Expand Down Expand Up @@ -61,7 +64,7 @@ jobs:
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends postgresql-client-17
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby-version }}
- name: Set up Ruby ${{ matrix.ruby_version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
Expand All @@ -76,9 +79,7 @@ jobs:
continue-on-error: true
run: |
mkdir -p ./coverage
bundle exec rspec --format progress \
--format RspecJunitFormatter -o ./coverage/test-results.xml \
--profile
bundle exec rspec
- name: Codecov Upload
uses: codecov/codecov-action@v4
with:
Expand All @@ -97,4 +98,8 @@ jobs:
file: ./coverage/test-results.xml
- name: Notify of test failure
if: steps.rspec-tests.outcome == 'failure'
run: exit 1
run: exit 1

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
19 changes: 12 additions & 7 deletions .github/workflows/rspec_sqlite_3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,19 @@ jobs:
- 3.3
# - jruby # We don't support jruby for sqlite yet
rails_version:
- 6_1
- 7_0
- 7_1
- 7_2
# - master # versions failing
- 8_0
exclude:
- ruby_version: jruby
rails_version: 7_1
- ruby_version: jruby
rails_version: 7_2
- ruby_version: jruby
rails_version: 8_0
- ruby_version: 3.1
rails_version: 8_0
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/rails_${{ matrix.rails_version }}${{ matrix.ruby_version == 'jruby' && '_jdbc' || '' }}_sqlite3.gemfile
CI: true
Expand All @@ -40,7 +43,7 @@ jobs:
RAILS_VERSION: ${{ matrix.rails_version }}
steps:
- uses: actions/checkout@v4
- name: Set up Ruby ${{ matrix.ruby-version }}
- name: Set up Ruby ${{ matrix.ruby_version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
Expand All @@ -55,9 +58,7 @@ jobs:
continue-on-error: true
run: |
mkdir -p ./coverage
bundle exec rspec --format progress \
--format RspecJunitFormatter -o ./coverage/test-results.xml \
--profile
bundle exec rspec
- name: Codecov Upload
uses: codecov/codecov-action@v4
with:
Expand All @@ -76,4 +77,8 @@ jobs:
file: ./coverage/test-results.xml
- name: Notify of test failure
if: steps.rspec-tests.outcome == 'failure'
run: exit 1
run: exit 1

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
6 changes: 5 additions & 1 deletion .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ jobs:
with:
bundler-cache: true
- name: Rubocop
run: "bundle exec rubocop"
run: "bundle exec rubocop"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
5 changes: 0 additions & 5 deletions .pryrc

This file was deleted.

7 changes: 3 additions & 4 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
--colour
--format documentation
--tty
--order random
--format progress
--format RspecJunitFormatter -o ./coverage/test-results.xml
--profile
22 changes: 21 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,24 @@ Style/CollectionMethods:
collect!: 'map!'
inject: 'reduce'
detect: 'detect'
find_all: 'select'
find_all: 'select'

ThreadSafety/NewThread:
Exclude:
- 'spec/shared_examples/*thread_safety_examples.rb'

## Rspec

RSpec/ExampleLength:
Max: 20

RSpec/IndexedLet:
AllowedPatterns:
- 'schema'
- 'tenant'

RSpec/MultipleExpectations:
Max: 5

RSpec/MultipleMemoizedHelpers:
Max: 10
Loading
Loading