diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml index b0676090..9578c6ed 100644 --- a/.github/workflows/close-stale-issues.yml +++ b/.github/workflows/close-stale-issues.yml @@ -27,4 +27,8 @@ jobs: exempt-issue-labels: 'pinned,security' stale-pr-label: 'stale' exempt-pr-labels: 'work-in-progress' - delete-branch: true \ No newline at end of file + delete-branch: true + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true \ No newline at end of file diff --git a/.github/workflows/gem-publish.yml b/.github/workflows/gem-publish.yml index 4060eaaa..f9dd8eb8 100644 --- a/.github/workflows/gem-publish.yml +++ b/.github/workflows/gem-publish.yml @@ -29,3 +29,7 @@ jobs: bundler: latest - name: Publish to RubyGems uses: rubygems/release-gem@v1 + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true \ No newline at end of file diff --git a/.github/workflows/rspec_mysql_8_0.yml b/.github/workflows/rspec_mysql_8_0.yml index 5679d5a4..8b9fc410 100644 --- a/.github/workflows/rspec_mysql_8_0.yml +++ b/.github/workflows/rspec_mysql_8_0.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/rspec_pg_14.yml b/.github/workflows/rspec_pg_14.yml index 893eb35f..68204769 100644 --- a/.github/workflows/rspec_pg_14.yml +++ b/.github/workflows/rspec_pg_14.yml @@ -98,4 +98,8 @@ jobs: file: ./coverage/test-results.xml - name: Notify of test failure if: steps.rspec-tests.outcome == 'failure' - run: exit 1 \ No newline at end of file + run: exit 1 + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true \ No newline at end of file diff --git a/.github/workflows/rspec_pg_15.yml b/.github/workflows/rspec_pg_15.yml index 6f1c9ee2..9c160aa2 100644 --- a/.github/workflows/rspec_pg_15.yml +++ b/.github/workflows/rspec_pg_15.yml @@ -98,4 +98,8 @@ jobs: file: ./coverage/test-results.xml - name: Notify of test failure if: steps.rspec-tests.outcome == 'failure' - run: exit 1 \ No newline at end of file + run: exit 1 + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true \ No newline at end of file diff --git a/.github/workflows/rspec_pg_16.yml b/.github/workflows/rspec_pg_16.yml index b3b4d109..1fefacbb 100644 --- a/.github/workflows/rspec_pg_16.yml +++ b/.github/workflows/rspec_pg_16.yml @@ -98,4 +98,8 @@ jobs: file: ./coverage/test-results.xml - name: Notify of test failure if: steps.rspec-tests.outcome == 'failure' - run: exit 1 \ No newline at end of file + run: exit 1 + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true \ No newline at end of file diff --git a/.github/workflows/rspec_pg_17.yml b/.github/workflows/rspec_pg_17.yml index ecb9e66d..34ed6db4 100644 --- a/.github/workflows/rspec_pg_17.yml +++ b/.github/workflows/rspec_pg_17.yml @@ -98,4 +98,8 @@ jobs: file: ./coverage/test-results.xml - name: Notify of test failure if: steps.rspec-tests.outcome == 'failure' - run: exit 1 \ No newline at end of file + run: exit 1 + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true \ No newline at end of file diff --git a/.github/workflows/rspec_sqlite_3.yml b/.github/workflows/rspec_sqlite_3.yml index 61cb1b56..89eda4fc 100644 --- a/.github/workflows/rspec_sqlite_3.yml +++ b/.github/workflows/rspec_sqlite_3.yml @@ -77,4 +77,8 @@ jobs: file: ./coverage/test-results.xml - name: Notify of test failure if: steps.rspec-tests.outcome == 'failure' - run: exit 1 \ No newline at end of file + run: exit 1 + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true \ No newline at end of file diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml index aa848c87..731e4c27 100644 --- a/.github/workflows/rubocop.yml +++ b/.github/workflows/rubocop.yml @@ -20,4 +20,8 @@ jobs: with: bundler-cache: true - name: Rubocop - run: "bundle exec rubocop" \ No newline at end of file + run: "bundle exec rubocop" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true \ No newline at end of file diff --git a/spec/apartment/adapters/postgresql_adapter_spec.rb b/spec/apartment/adapters/postgresql_adapter_spec.rb index 71320f86..61a53ee7 100644 --- a/spec/apartment/adapters/postgresql_adapter_spec.rb +++ b/spec/apartment/adapters/postgresql_adapter_spec.rb @@ -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 } @@ -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 @@ -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) @@ -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 diff --git a/spec/shared_examples/connection_adapter_examples.rb b/spec/shared_examples/connection_adapter_examples.rb index 837a167f..48428f31 100644 --- a/spec/shared_examples/connection_adapter_examples.rb +++ b/spec/shared_examples/connection_adapter_examples.rb @@ -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' diff --git a/spec/shared_examples/core_adapter_examples.rb b/spec/shared_examples/core_adapter_examples.rb index b7c1cede..c6528503 100644 --- a/spec/shared_examples/core_adapter_examples.rb +++ b/spec/shared_examples/core_adapter_examples.rb @@ -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' diff --git a/spec/shared_examples/schema_adapter_examples.rb b/spec/shared_examples/schema_adapter_examples.rb index 0a80cc61..851529c4 100644 --- a/spec/shared_examples/schema_adapter_examples.rb +++ b/spec/shared_examples/schema_adapter_examples.rb @@ -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'