Skip to content

Commit 84b35be

Browse files
aidanharanAidan Haran
andauthored
Skip tests on Windows because they fail on AppVeyor CI due to file permissions issue (#920)
Co-authored-by: Aidan Haran <aharan@fusioneer.com>
1 parent 778dc42 commit 84b35be

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

test/cases/coerced_tests.rb

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -768,11 +768,6 @@ def test_sqlserver_structure_load
768768
end
769769
end
770770

771-
class DatabaseTasksDumpSchemaCacheTest < ActiveRecord::TestCase
772-
# Skip this test with /tmp/my_schema_cache.yml path on Windows.
773-
coerce_tests! :test_dump_schema_cache if RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
774-
end
775-
776771
class DatabaseTasksCreateAllTest < ActiveRecord::TestCase
777772
# We extend `local_database?` so that common VM IPs can be used.
778773
coerce_tests! :test_ignores_remote_databases, :test_warning_for_remote_databases
@@ -1534,13 +1529,20 @@ def test_statement_cache_values_differ_coerced
15341529
module ActiveRecord
15351530
module ConnectionAdapters
15361531
class SchemaCacheTest < ActiveRecord::TestCase
1532+
# Tests fail on Windows AppVeyor CI with 'Permission denied' error when renaming file during `File.atomic_write` call.
1533+
coerce_tests! :test_yaml_dump_and_load, :test_yaml_dump_and_load_with_gzip if RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
1534+
15371535
# Ruby 2.5 and 2.6 have issues to marshal Time before 1900. 2012.sql has one column with default value 1753
15381536
coerce_tests! :test_marshal_dump_and_load_with_gzip, :test_marshal_dump_and_load_via_disk
1539-
def test_marshal_dump_and_load_with_gzip_coerced
1540-
with_marshable_time_defaults { original_test_marshal_dump_and_load_with_gzip }
1541-
end
1542-
def test_marshal_dump_and_load_via_disk_coerced
1543-
with_marshable_time_defaults { original_test_marshal_dump_and_load_via_disk }
1537+
1538+
# Tests fail on Windows AppVeyor CI with 'Permission denied' error when renaming file during `File.atomic_write` call.
1539+
unless RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
1540+
def test_marshal_dump_and_load_with_gzip_coerced
1541+
with_marshable_time_defaults { original_test_marshal_dump_and_load_with_gzip }
1542+
end
1543+
def test_marshal_dump_and_load_via_disk_coerced
1544+
with_marshable_time_defaults { original_test_marshal_dump_and_load_via_disk }
1545+
end
15441546
end
15451547

15461548
private

0 commit comments

Comments
 (0)