diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..5c7e7a61 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,86 @@ +# Inspired from: +# - https://github.com/cockroachdb/sqlalchemy-cockroachdb/blob/master/.github/workflows/ci.yml +# - https://github.com/rgeo/activerecord-postgis-adapter/blob/master/.github/workflows/tests.yml +name: Test + +on: + # Triggers the workflow on push or pull request events. + push: + # This should disable running the workflow on tags, according to the + # on.. GitHub Actions docs. + branches: + - "*" + pull_request: + types: [opened, reopened, synchronize] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# This allows a subsequently queued workflow run to interrupt previous runs. +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + crdb: [v23.1.5] + ruby: [ruby-head] + name: Test (crdb=${{ matrix.crdb }} ruby=${{ matrix.ruby }}) + steps: + - name: Set Up Actions + uses: actions/checkout@v3 + - name: Install GEOS + run: sudo apt-get install libgeos-dev + - name: Set Up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Install and Start Cockroachdb + run: | + # Download CockroachDB + wget -qO- https://binaries.cockroachdb.com/cockroach-${{ matrix.crdb }}.linux-amd64.tgz | tar xvz + + export PATH=./cockroach-${{ matrix.crdb }}.linux-amd64/:$PATH + readonly urlfile=cockroach-url + + # Start a CockroachDB server and wait for it to become ready. + rm -f "$urlfile" + rm -rf cockroach-data + # Start CockroachDB. + cockroach start-single-node --max-sql-memory=25% --cache=25% --insecure --host=localhost --spatial-libs=./cockroach-${{ matrix.crdb }}.linux-amd64/lib --listening-url-file="$urlfile" >/dev/null 2>&1 & + # Ensure CockroachDB is stopped on script exit. + # Wait until CockroachDB has started. + for i in {0..3}; do + [[ -f "$urlfile" ]] && break + backoff=$((2 ** i)) + echo "server not yet available; sleeping for $backoff seconds" + sleep $backoff + done + cockroach sql --insecure -e " + CREATE DATABASE activerecord_unittest; + CREATE DATABASE activerecord_unittest2; + SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false; + SET CLUSTER SETTING sql.stats.histogram_collection.enabled = false; + SET CLUSTER SETTING jobs.retention_time = '180s'; + SET CLUSTER SETTING sql.defaults.experimental_alter_column_type.enabled = 'true'; + + ALTER RANGE default CONFIGURE ZONE USING num_replicas = 1, gc.ttlseconds = 30; + ALTER TABLE system.public.jobs CONFIGURE ZONE USING num_replicas = 1, gc.ttlseconds = 30; + ALTER RANGE meta CONFIGURE ZONE USING num_replicas = 1, gc.ttlseconds = 30; + ALTER RANGE system CONFIGURE ZONE USING num_replicas = 1, gc.ttlseconds = 30; + ALTER RANGE liveness CONFIGURE ZONE USING num_replicas = 1, gc.ttlseconds = 30; + + SET CLUSTER SETTING kv.range_merge.queue_interval = '50ms'; + SET CLUSTER SETTING kv.raft_log.disable_synchronization_unsafe = 'true'; + SET CLUSTER SETTING jobs.registry.interval.cancel = '180s'; + SET CLUSTER SETTING jobs.registry.interval.gc = '30s'; + SET CLUSTER SETTING kv.range_split.by_load_merge_delay = '5s'; + + SET CLUSTER SETTING sql.defaults.experimental_temporary_tables.enabled = 'true'; + " + - name: Test + run: bundle exec rake test diff --git a/Gemfile b/Gemfile index 04720b61..8c4d1671 100644 --- a/Gemfile +++ b/Gemfile @@ -14,7 +14,7 @@ module RailsTag def gemspec_requirement File - .foreach("activerecord-cockroachdb-adapter.gemspec", chomp: true) + .foreach(File.expand_path("activerecord-cockroachdb-adapter.gemspec", __dir__), chomp: true) .find { _1[/add_dependency\s.activerecord.,\s.(.*)./] } Gem::Requirement.new(Regexp.last_match(1)) diff --git a/README.md b/README.md index 9732bdf5..1fe67c07 100644 --- a/README.md +++ b/README.md @@ -321,7 +321,7 @@ p modified_fac.parse_wkt(wkt) #=> # ``` -Be careful when performing calculations on potentially invalid geometries, as the results might be nonsensical. For example, the area returned of an hourglass made of 2 equivalent triangles with a self-intersection in the middle is 0. +Be careful when performing calculations on potentially invalid geometries, as the results might be nonsensical. For example, the area returned of an hourglass made of 2 equivalent triangles with a self-intersection in the middle is 0. Note that when using the `spherical_factory`, there is a chance that valid geometries will be interpreted as invalid due to floating point issues with small geometries. diff --git a/lib/active_record/connection_adapters/cockroachdb/schema_statements.rb b/lib/active_record/connection_adapters/cockroachdb/schema_statements.rb index 0f399ed2..d7d8c42e 100644 --- a/lib/active_record/connection_adapters/cockroachdb/schema_statements.rb +++ b/lib/active_record/connection_adapters/cockroachdb/schema_statements.rb @@ -112,7 +112,7 @@ def new_column_from_field(table_name, field) # since type alone is not enough to format the column. # Ex. type_to_sql(:geography, limit: "Point,4326") # => "geography(Point,4326)" - # + # def type_to_sql(type, limit: nil, precision: nil, scale: nil, array: nil, **) # :nodoc: sql = \ case type.to_s diff --git a/test/cases/adapters/postgresql/active_schema_test.rb b/test/cases/adapters/postgresql/active_schema_test.rb index ea01ba15..682f3624 100644 --- a/test/cases/adapters/postgresql/active_schema_test.rb +++ b/test/cases/adapters/postgresql/active_schema_test.rb @@ -64,8 +64,8 @@ def test_add_index end private - def method_missing(method_symbol, *arguments) - ActiveRecord::Base.connection.send(method_symbol, *arguments) + def method_missing(...) + ActiveRecord::Base.connection.send(...) end end end diff --git a/test/cases/adapters/postgresql/postgis_test.rb b/test/cases/adapters/postgresql/postgis_test.rb index 4d19ee24..6d76e9b6 100644 --- a/test/cases/adapters/postgresql/postgis_test.rb +++ b/test/cases/adapters/postgresql/postgis_test.rb @@ -148,8 +148,10 @@ def test_spatial_factory_retrieval def test_point_to_json obj = klass.new assert_match(/"latlon":null/, obj.to_json) - obj.latlon = factory.point(1.0, 2.0) - assert_match(/"latlon":"POINT\s\(1\.0\s2\.0\)"/, obj.to_json) + obj.latlon = factory.point(1.1, 2.0) + # NOTE: rgeo opiniated in trimming numbers (e.g 1.0 would be trimmed to 1). + # We follow this convention here. + assert_match(/"latlon":"POINT\s\(1.1\s2\)"/, obj.to_json) end def test_custom_column diff --git a/test/cases/adapters/postgresql/quoting_test.rb b/test/cases/adapters/postgresql/quoting_test.rb new file mode 100644 index 00000000..7e2add8b --- /dev/null +++ b/test/cases/adapters/postgresql/quoting_test.rb @@ -0,0 +1,30 @@ +require "cases/helper_cockroachdb" + +# Load dependencies from ActiveRecord test suite +require "support/schema_dumping_helper" + +module CockroachDB + class PostgresqlQuotingTest < ActiveRecord::PostgreSQLTestCase + def setup + @conn = ActiveRecord::Base.connection + @raise_int_wider_than_64bit = ActiveRecord.raise_int_wider_than_64bit + end + + # Replace the original test since numbers are quoted. + def test_do_not_raise_when_int_is_not_wider_than_64bit + value = 9223372036854775807 + assert_equal "'9223372036854775807'", @conn.quote(value) + + value = -9223372036854775808 + assert_equal "'-9223372036854775808'", @conn.quote(value) + end + + # Replace the original test since numbers are quoted. + def test_do_not_raise_when_raise_int_wider_than_64bit_is_false + ActiveRecord.raise_int_wider_than_64bit = false + value = 9223372036854775807 + 1 + assert_equal "'9223372036854775808'", @conn.quote(value) + ActiveRecord.raise_int_wider_than_64bit = @raise_int_wider_than_64bit + end + end +end diff --git a/test/cases/connection_adapters/schema_cache_test.rb b/test/cases/connection_adapters/schema_cache_test.rb index 73b71b60..663a3d5a 100644 --- a/test/cases/connection_adapters/schema_cache_test.rb +++ b/test/cases/connection_adapters/schema_cache_test.rb @@ -15,7 +15,7 @@ def setup # See test/excludes/ActiveRecord/ConnectionAdapters/SchemaCacheTest.rb def test_yaml_loads_5_1_dump body = File.open(schema_dump_path).read - cache = YAML.load(body) + cache = YAML.unsafe_load(body) assert_no_queries do assert_equal 11, cache.columns("posts").size @@ -32,7 +32,7 @@ def test_yaml_loads_5_1_dump # See test/excludes/ActiveRecord/ConnectionAdapters/SchemaCacheTest.rb def test_yaml_loads_5_1_dump_without_indexes_still_queries_for_indexes body = File.open(schema_dump_path).read - @cache = YAML.load(body) + @cache = YAML.unsafe_load(body) # Simulate assignment in railtie after loading the cache. old_cache, @connection.schema_cache = @connection.schema_cache, @cache @@ -51,7 +51,7 @@ def test_yaml_loads_5_1_dump_without_indexes_still_queries_for_indexes # See test/excludes/ActiveRecord/ConnectionAdapters/SchemaCacheTest.rb def test_yaml_loads_5_1_dump_without_database_version_still_queries_for_database_version body = File.open(schema_dump_path).read - @cache = YAML.load(body) + @cache = YAML.unsafe_load(body) # Simulate assignment in railtie after loading the cache. old_cache, @connection.schema_cache = @connection.schema_cache, @cache diff --git a/test/cases/fixtures_test.rb b/test/cases/fixtures_test.rb index f0a5698a..db52d24a 100644 --- a/test/cases/fixtures_test.rb +++ b/test/cases/fixtures_test.rb @@ -313,12 +313,13 @@ def before_setup firm_id bigint, firm_name character varying, credit_limit integer, + status string, #{'a' * max_identifier_length} integer ) ") Company.connection.drop_table :companies, if_exists: true - Company.connection.exec_query("CREATE SEQUENCE companies_nonstd_seq") + Company.connection.exec_query("CREATE SEQUENCE IF NOT EXISTS companies_nonstd_seq") Company.connection.exec_query(" CREATE TABLE companies ( id BIGINT PRIMARY KEY DEFAULT nextval('companies_nonstd_seq'), @@ -329,7 +330,8 @@ def before_setup client_of bigint, rating bigint, account_id integer, - description character varying + description character varying, + status integer ) ") @@ -361,6 +363,7 @@ def teardown t.references :firm, index: false t.string :firm_name t.integer :credit_limit + t.string :status t.integer "a" * max_identifier_length end @@ -375,6 +378,7 @@ def teardown t.bigint :rating, default: 1 t.integer :account_id t.string :description, default: "" + t.integer :status, default: 0 t.index [:name, :rating], order: :desc t.index [:name, :description], length: 10 t.index [:firm_id, :type, :rating], name: "company_index", length: { type: 10 }, order: { rating: :desc } diff --git a/test/cases/helper_cockroachdb.rb b/test/cases/helper_cockroachdb.rb index ceac8cc3..2bcbfe24 100644 --- a/test/cases/helper_cockroachdb.rb +++ b/test/cases/helper_cockroachdb.rb @@ -1,5 +1,7 @@ -require 'bundler/setup' -Bundler.require :development +require 'bundler' +Bundler.setup + +require "minitest/excludes" # Turn on debugging for the test environment ENV['DEBUG_COCKROACHDB_ADAPTER'] = "1" diff --git a/test/cases/relation_test.rb b/test/cases/relation_test.rb index 9ed834a8..6d2d9eda 100644 --- a/test/cases/relation_test.rb +++ b/test/cases/relation_test.rb @@ -19,7 +19,7 @@ def test_relation_with_annotation_includes_comment_in_to_sql def test_relation_with_annotation_filters_sql_comment_delimiters post_with_annotation = Post.where(id: 1).annotate("**//foo//**") - assert_match %r{= '1' /\* foo \*/}, post_with_annotation.to_sql + assert_includes post_with_annotation.to_sql, "= '1' /* ** //foo// ** */" end def test_respond_to_for_non_selected_element diff --git a/test/excludes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/QuotingTest.rb b/test/excludes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/QuotingTest.rb new file mode 100644 index 00000000..ea418e70 --- /dev/null +++ b/test/excludes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/QuotingTest.rb @@ -0,0 +1,3 @@ +exclude :test_do_not_raise_when_int_is_not_wider_than_64bit, "replaced for correct quoting" +exclude :test_do_not_raise_when_raise_int_wider_than_64bit_is_false, "replaced for correct quoting" +exclude :test_raise_when_int_is_wider_than_64bit, "since integers are stringified there is not 64bit limit" diff --git a/test/excludes/LogSubscriberTest.rb b/test/excludes/LogSubscriberTest.rb deleted file mode 100644 index b86d81a1..00000000 --- a/test/excludes/LogSubscriberTest.rb +++ /dev/null @@ -1 +0,0 @@ -exclude :test_vebose_query_logs, "Skip the test for not including the bundler gems files in the log, as the rails is obtained from the source" diff --git a/test/excludes/PostgresqlArrayTest.rb b/test/excludes/PostgresqlArrayTest.rb index b82b16da..132e4a7a 100644 --- a/test/excludes/PostgresqlArrayTest.rb +++ b/test/excludes/PostgresqlArrayTest.rb @@ -5,7 +5,6 @@ exclude :test_attribute_for_inspect_for_array_field_for_large_array, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_column, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_default, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" -exclude :test_insert_fixtures, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_string_quoting_rules_match_pg_behavior, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_change_column_default_with_array, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_encoding_arrays_of_utf8_strings, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" diff --git a/test/excludes/PostgresqlDataTypeTest.rb b/test/excludes/PostgresqlDataTypeTest.rb index 5b733446..b193d21d 100644 --- a/test/excludes/PostgresqlDataTypeTest.rb +++ b/test/excludes/PostgresqlDataTypeTest.rb @@ -2,6 +2,5 @@ exclude :test_data_type_of_oid_types, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_update_oid, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_data_type_of_time_types, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" -exclude :test_update_time, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_oid_values, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_time_values, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" diff --git a/test/excludes/PostgresqlHstoreTest.rb b/test/excludes/PostgresqlHstoreTest.rb index 239adde6..3d995250 100644 --- a/test/excludes/PostgresqlHstoreTest.rb +++ b/test/excludes/PostgresqlHstoreTest.rb @@ -1,6 +1,3 @@ -exclude :test_gen2, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" -exclude :test_parse4, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" -exclude :test_parse3, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_quotes, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_select_multikey, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_type_cast_hstore, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" @@ -17,14 +14,12 @@ exclude :test_with_store_accessors, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_array_strings_with_commas, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_comma, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" -exclude :test_gen4, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_yaml_round_trip_with_store_accessors, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_hstore_included_in_extensions, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_array_strings_with_null_strings, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_hstore_migration, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_duplication_with_store_accessors, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_disable_enable_hstore, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" -exclude :test_gen1, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_array_cycle, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_contains_nils, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_change_table_supports_hstore, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" diff --git a/test/excludes/PostgresqlRangeTest.rb b/test/excludes/PostgresqlRangeTest.rb index 695fbf29..53989f67 100644 --- a/test/excludes/PostgresqlRangeTest.rb +++ b/test/excludes/PostgresqlRangeTest.rb @@ -1,38 +1,3 @@ -exclude :test_create_int4range, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_timezone_awareness_tzrange, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_escaped_tsrange, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_update_tsrange, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_create_tsrange, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_infinity_values, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_update_int8range, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_ranges_correctly_escape_input, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_int8range_values, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_numrange_values, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_timezone_awareness_tsrange_preserve_usec, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_endless_range_values, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_int4range_values, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_update_daterange, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_update_numrange, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_update_tsrange_preserve_usec, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_escaped_tstzrange, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_update_tstzrange_preserve_usec, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_ranges_correctly_unescape_output, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_where_by_attribute_with_range_in_array, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_tsrange_values, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_where_by_attribute_with_range, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_create_tsrange_preseve_usec, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_update_int4range, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_create_daterange, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_create_tstzrange_preserve_usec, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_timezone_awareness_tsrange, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_daterange_values, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_update_all_with_ranges, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_custom_range_values, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_create_numrange, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_data_type_of_range_types, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_create_tstzrange, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_exclude_beginning_for_subtypes_without_succ_method_is_not_supported, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_tstzrange_values, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_update_tstzrange, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_create_int8range, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" -exclude :test_create_tsrange_preserve_usec, "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" +message = "CockroachDB doesn't support ranges. See https://github.com/cockroachdb/cockroach/issues/27791" +# No test is relevant in this class. +instance_methods.grep(/\Atest_/).each { exclude _1, message } diff --git a/test/excludes/SchemaDumperTest.rb b/test/excludes/SchemaDumperTest.rb index ec0c1b59..21219b4b 100644 --- a/test/excludes/SchemaDumperTest.rb +++ b/test/excludes/SchemaDumperTest.rb @@ -1,5 +1,4 @@ exclude :test_schema_dump_allows_array_of_decimal_defaults, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" -exclude :test_schema_dump_expression_indices, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_foreign_keys_are_dumped_at_the_bottom_to_circumvent_dependency_issues, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_schema_dump_interval_type, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" exclude :test_do_not_dump_foreign_keys_for_ignored_tables, "Skipping until we can triage further. See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/48" diff --git a/test/support/rake_helpers.rb b/test/support/rake_helpers.rb index 09e61e1d..07a82807 100644 --- a/test/support/rake_helpers.rb +++ b/test/support/rake_helpers.rb @@ -12,7 +12,7 @@ def test_files ar_test_files = ENV.fetch('TEST_FILES_AR', '') cr_test_files = ENV.fetch('TEST_FILES', '') - return all_test_file if ar_test_files.empty? && cr_test_files.empty? + return all_test_files if ar_test_files.empty? && cr_test_files.empty? ar_test_files = ar_test_files. split(',').