From e5a01181bdbfcc601f4e9e00645f617fe658ef4b Mon Sep 17 00:00:00 2001 From: Aidan Haran Date: Wed, 28 Apr 2021 16:09:18 +0100 Subject: [PATCH] Skip tests on Windows because they fail on AppVeyor CI due to file permissions issue --- test/cases/coerced_tests.rb | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/test/cases/coerced_tests.rb b/test/cases/coerced_tests.rb index 9e0e660f8..565863ba2 100644 --- a/test/cases/coerced_tests.rb +++ b/test/cases/coerced_tests.rb @@ -768,11 +768,6 @@ def test_sqlserver_structure_load end end - class DatabaseTasksDumpSchemaCacheTest < ActiveRecord::TestCase - # Skip this test with /tmp/my_schema_cache.yml path on Windows. - coerce_tests! :test_dump_schema_cache if RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ - end - class DatabaseTasksCreateAllTest < ActiveRecord::TestCase # We extend `local_database?` so that common VM IPs can be used. coerce_tests! :test_ignores_remote_databases, :test_warning_for_remote_databases @@ -1524,13 +1519,20 @@ def test_statement_cache_values_differ_coerced module ActiveRecord module ConnectionAdapters class SchemaCacheTest < ActiveRecord::TestCase + # Tests fail on Windows AppVeyor CI with 'Permission denied' error when renaming file during `File.atomic_write` call. + coerce_tests! :test_yaml_dump_and_load, :test_yaml_dump_and_load_with_gzip if RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ + # Ruby 2.5 and 2.6 have issues to marshal Time before 1900. 2012.sql has one column with default value 1753 coerce_tests! :test_marshal_dump_and_load_with_gzip, :test_marshal_dump_and_load_via_disk - def test_marshal_dump_and_load_with_gzip_coerced - with_marshable_time_defaults { original_test_marshal_dump_and_load_with_gzip } - end - def test_marshal_dump_and_load_via_disk_coerced - with_marshable_time_defaults { original_test_marshal_dump_and_load_via_disk } + + # Tests fail on Windows AppVeyor CI with 'Permission denied' error when renaming file during `File.atomic_write` call. + unless RbConfig::CONFIG["host_os"] =~ /mswin|mingw/ + def test_marshal_dump_and_load_with_gzip_coerced + with_marshable_time_defaults { original_test_marshal_dump_and_load_with_gzip } + end + def test_marshal_dump_and_load_via_disk_coerced + with_marshable_time_defaults { original_test_marshal_dump_and_load_via_disk } + end end private