Skip to content

Commit 5f0c423

Browse files
authored
Remove coerced tests that were removed from Rails test suite (#887)
1 parent bc1d46e commit 5f0c423

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

test/cases/coerced_tests.rb

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,12 @@ def test_validate_uniqueness_with_limit_and_utf8_coerced
2323
end
2424
end
2525
end
26-
27-
# Skip the test if database is case-insensitive.
28-
coerce_tests! :test_validate_case_sensitive_uniqueness_by_default
29-
def test_validate_case_sensitive_uniqueness_by_default_coerced
30-
database_collation = connection.select_one("SELECT collation_name FROM sys.databases WHERE name = 'activerecord_unittest'").values.first
31-
skip if database_collation.include?("_CI_")
32-
33-
original_test_validate_case_sensitive_uniqueness_by_default_coerced
34-
end
3526
end
3627

3728
require "models/event"
3829
module ActiveRecord
3930
class AdapterTest < ActiveRecord::TestCase
4031
# I really don`t think we can support legacy binds.
41-
coerce_tests! :test_select_all_with_legacy_binds
4232
coerce_tests! :test_insert_update_delete_with_legacy_binds
4333

4434
# As far as I can tell, SQL Server does not support null bytes in strings.
@@ -54,13 +44,6 @@ def test_value_limit_violations_are_translated_to_specific_exception_coerced
5444
assert_not_nil error.cause
5545
end
5646
end
57-
58-
# Fix randomly failing test. The loading of the model's schema was affecting the test.
59-
coerce_tests! :test_errors_when_an_insert_query_is_called_while_preventing_writes
60-
def test_errors_when_an_insert_query_is_called_while_preventing_writes_coerced
61-
Subscriber.send(:load_schema!)
62-
original_test_errors_when_an_insert_query_is_called_while_preventing_writes
63-
end
6447
end
6548
end
6649

@@ -1456,28 +1439,6 @@ def test_insert_all_coerced
14561439
end
14571440
end
14581441

1459-
require "models/citation"
1460-
class EagerLoadingTooManyIdsTest < ActiveRecord::TestCase
1461-
# Original Rails test fails with SQL Server error message "The query processor ran out of internal resources and
1462-
# could not produce a query plan". This error goes away if you change database compatibility level to 110 (SQL 2012)
1463-
# (see https://www.mssqltips.com/sqlservertip/5279/sql-server-error-query-processor-ran-out-of-internal-resources-and-could-not-produce-a-query-plan/).
1464-
# However, you cannot change the compatibility level during a test. The purpose of the test is to ensure that an
1465-
# unprepared statement is used if the number of values exceeds the adapter's `bind_params_length`. The coerced test
1466-
# still does this as there will be 32,768 remaining citation records in the database and the `bind_params_length` of
1467-
# adapter is 2,098.
1468-
coerce_tests! :test_eager_loading_too_may_ids
1469-
def test_eager_loading_too_may_ids_coerced
1470-
# Remove excess records.
1471-
Citation.limit(32768).order(id: :desc).delete_all
1472-
1473-
# Perform test
1474-
citation_count = Citation.count
1475-
assert_sql(/WHERE \(\[citations\]\.\[id\] IN \(0, 1/) do
1476-
assert_equal citation_count, Citation.eager_load(:citations).offset(0).size
1477-
end
1478-
end
1479-
end
1480-
14811442
class LogSubscriberTest < ActiveRecord::TestCase
14821443
# Call original test from coerced test. Fixes issue on CI with Rails installed as a gem.
14831444
coerce_tests! :test_vebose_query_logs

0 commit comments

Comments
 (0)