aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-06-13 22:02:38 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-06-13 22:10:46 +0900
commit4f7d32311e6500eac52fee1aedd4aca18d73fce5 (patch)
treeb3ce371654508bb3a25613b062196f4af6f3d775 /activerecord/test
parent98a57aa5f610bc66af31af409c72173cdeeb3c9e (diff)
downloadrails-4f7d32311e6500eac52fee1aedd4aca18d73fce5.tar.gz
rails-4f7d32311e6500eac52fee1aedd4aca18d73fce5.tar.bz2
rails-4f7d32311e6500eac52fee1aedd4aca18d73fce5.zip
Avoid implicit rollback when testing migration
"schema_migrations" is hard dropped by some existing tests, so testing migration in using transactional tests may cause implicit creation and rollback "schema_migrations" table, it makes migration tests flaky. https://buildkite.com/rails/rails/builds/61692#42383249-30be-4508-b1fb-a7bb27600c8e/999-1010 https://buildkite.com/rails/rails/builds/61694#6e462ad3-41d8-4e26-95ce-728495b0ac64/999-1010
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/adapters/postgresql/uuid_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/uuid_test.rb b/activerecord/test/cases/adapters/postgresql/uuid_test.rb
index d2d8ea8042..fe69b82764 100644
--- a/activerecord/test/cases/adapters/postgresql/uuid_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/uuid_test.rb
@@ -283,6 +283,7 @@ class PostgresqlUUIDGenerationTest < ActiveRecord::PostgreSQLTestCase
end
end
+ uses_transaction \
def test_schema_dumper_for_uuid_primary_key_default_in_legacy_migration
@verbose_was = ActiveRecord::Migration.verbose
ActiveRecord::Migration.verbose = false
@@ -331,6 +332,7 @@ class PostgresqlUUIDTestNilDefault < ActiveRecord::PostgreSQLTestCase
assert_match(/\bcreate_table "pg_uuids", id: :uuid, default: nil/, schema)
end
+ uses_transaction \
def test_schema_dumper_for_uuid_primary_key_with_default_nil_in_legacy_migration
@verbose_was = ActiveRecord::Migration.verbose
ActiveRecord::Migration.verbose = false