Skip to content

Commit

Permalink
Fix shared adapter references
Browse files Browse the repository at this point in the history
  • Loading branch information
mnovelo committed Nov 4, 2024
1 parent 78dd6a9 commit 68ab846
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 17 deletions.
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
4 changes: 4 additions & 0 deletions .github/workflows/rspec_mysql_8_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,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
6 changes: 5 additions & 1 deletion .github/workflows/rspec_pg_14.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,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
6 changes: 5 additions & 1 deletion .github/workflows/rspec_pg_15.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,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
6 changes: 5 additions & 1 deletion .github/workflows/rspec_pg_16.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,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
6 changes: 5 additions & 1 deletion .github/workflows/rspec_pg_17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,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
6 changes: 5 additions & 1 deletion .github/workflows/rspec_sqlite_3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,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
8 changes: 3 additions & 5 deletions spec/apartment/adapters/postgresql_adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
describe Apartment::Adapters::PostgresqlAdapter, database: :postgresql do
subject(:adapter) { described_class.new(config) }

it_behaves_like 'a schema based apartment adapter'

context 'when using schemas with schema.rb' do
before { Apartment.use_schemas = true }

Expand All @@ -20,7 +18,7 @@ def tenant_names

let(:default_tenant) { subject.switch { ActiveRecord::Base.connection.schema_search_path.delete('"') } }

it_behaves_like 'a schema based apartment adapter'
it_behaves_like 'a schema based adapter'
end

context 'when using schemas with SQL dump' do
Expand All @@ -40,7 +38,7 @@ def tenant_names

let(:default_tenant) { subject.switch { ActiveRecord::Base.connection.schema_search_path.delete('"') } }

it_behaves_like 'a schema based apartment adapter'
it_behaves_like 'a schema based adapter'

it 'allows for dashes in the schema name' do
expect { Apartment::Tenant.create('has-dashes') }.not_to(raise_error)
Expand All @@ -57,6 +55,6 @@ def tenant_names

let(:default_tenant) { subject.switch { ActiveRecord::Base.connection.current_database } }

it_behaves_like 'a connection based apartment adapter'
it_behaves_like 'a connection based adapter'
end
end
4 changes: 2 additions & 2 deletions spec/shared_examples/connection_adapter_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@
end
end

shared_examples 'a connection based apartment adapter' do
shared_examples 'a connection based adapter' do
# Include core adapter functionality first
it_behaves_like 'a basic apartment adapter'
it_behaves_like 'a basic adapter'

# Then test connection-specific features
it_behaves_like 'handles database connections'
Expand Down
2 changes: 1 addition & 1 deletion spec/shared_examples/core_adapter_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
end

# Main example group that all adapters should include
shared_examples 'a basic apartment adapter' do
shared_examples 'a basic adapter' do
it_behaves_like 'a tenant creator'
it_behaves_like 'a tenant switcher'
it_behaves_like 'a tenant dropper'
Expand Down
4 changes: 2 additions & 2 deletions spec/shared_examples/schema_adapter_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,9 @@ def cleanup_test_schema
end
end

shared_examples 'a schema based apartment adapter', database: :postgresql do
shared_examples 'a schema based adapter', database: :postgresql do
# Include core adapter functionality first
it_behaves_like 'a basic apartment adapter'
it_behaves_like 'a basic adapter'

# Then test schema-specific features
it_behaves_like 'handles schema search paths'
Expand Down

0 comments on commit 68ab846

Please sign in to comment.