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

Coerce tests that are not testing SQL Server #1124

Merged
merged 1 commit into from
Oct 19, 2023
Merged
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
44 changes: 44 additions & 0 deletions test/cases/coerced_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,9 @@ def test_schema_dump_includes_decimal_options_coerced
output = dump_all_table_schema([/^[^n]/])
assert_match %r{precision: 3,[[:space:]]+scale: 2,[[:space:]]+default: 2\.78}, output
end

# Tests are not about a specific adapter.
coerce_tests! :test_do_not_dump_foreign_keys_when_bypassed_by_config
end

class SchemaDumperDefaultsTest < ActiveRecord::TestCase
Expand Down Expand Up @@ -2611,6 +2614,47 @@ class StoreTest < ActiveRecord::TestCase
Admin::User.attribute :json_options, ActiveRecord::Type::SQLServer::Json.new
end

class TestDatabasesTest < ActiveRecord::TestCase
# Tests are not about a specific adapter.
coerce_all_tests!
end

module ActiveRecord
module ConnectionAdapters
class ConnectionHandlersShardingDbTest < ActiveRecord::TestCase
# Tests are not about a specific adapter.
coerce_all_tests!
end
end
end

module ActiveRecord
module ConnectionAdapters
class ConnectionSwappingNestedTest < ActiveRecord::TestCase
# Tests are not about a specific adapter.
coerce_all_tests!
end
end
end

module ActiveRecord
module ConnectionAdapters
class ConnectionHandlersMultiDbTest < ActiveRecord::TestCase
# Tests are not about a specific adapter.
coerce_tests! :test_switching_connections_via_handler
end
end
end

module ActiveRecord
module ConnectionAdapters
class ConnectionHandlersMultiPoolConfigTest < ActiveRecord::TestCase
# Tests are not about a specific adapter.
coerce_all_tests!
end
end
end

# TODO: Need to uncoerce the 'SerializedAttributeTest' tests before releasing adapter for Rails 7.1
class SerializedAttributeTest < ActiveRecord::TestCase
coerce_all_tests!
Expand Down
7 changes: 0 additions & 7 deletions test/cases/helper_sqlserver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class TestCase < ActiveSupport::TestCase

setup :ensure_clean_rails_env
setup :remove_backtrace_silencers
setup :cleanup_sqlite_databases

private

Expand All @@ -39,12 +38,6 @@ def remove_backtrace_silencers
Rails.backtrace_cleaner.remove_silencers!
end

# Cleanup the SQLite database created by previous runs of the Rails ActiveRecord test suite.
def cleanup_sqlite_databases
sqlite_db_dir = File.join(ARTest::SQLServer.test_root_sqlserver, "db")
Dir.glob("#{sqlite_db_dir}/**").each { |f| File.delete(f) }
end

def host_windows?
RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
end
Expand Down
Loading