Skip to content

Commit 7c01721

Browse files
author
Aidan Haran
committed
Skip tests on Windows because they fail on AppVeyor CI due to file permissions issue
1 parent 1cc444b commit 7c01721

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

test/cases/coerced_tests.rb

Lines changed: 20 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
@@ -784,6 +779,15 @@ class DatabaseTasksDropAllTest < ActiveRecord::TestCase
784779
end
785780
end
786781

782+
module ActiveRecord
783+
module ConnectionAdapters
784+
class SchemaCacheTest < ActiveRecord::TestCase
785+
# Skipping because test fails on Windows AppVeyor CI with 'Permission denied' error when renaming file during `File.atomic_write` call.
786+
coerce_tests! :test_yaml_dump_and_load, :test_yaml_dump_and_load_with_gzip if RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
787+
end
788+
end
789+
end
790+
787791
class DefaultScopingTest < ActiveRecord::TestCase
788792
# We are not doing order duplicate removal anymore.
789793
coerce_tests! :test_order_in_default_scope_should_not_prevail
@@ -1526,11 +1530,17 @@ module ConnectionAdapters
15261530
class SchemaCacheTest < ActiveRecord::TestCase
15271531
# Ruby 2.5 and 2.6 have issues to marshal Time before 1900. 2012.sql has one column with default value 1753
15281532
coerce_tests! :test_marshal_dump_and_load_with_gzip, :test_marshal_dump_and_load_via_disk
1529-
def test_marshal_dump_and_load_with_gzip_coerced
1530-
with_marshable_time_defaults { original_test_marshal_dump_and_load_with_gzip }
1531-
end
1532-
def test_marshal_dump_and_load_via_disk_coerced
1533-
with_marshable_time_defaults { original_test_marshal_dump_and_load_via_disk }
1533+
1534+
# Skipping because test fails on Windows AppVeyor CI with 'Permission denied' error when renaming file during `File.atomic_write` call.
1535+
unless RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
1536+
coerce_tests! :test_yaml_dump_and_load_with_gzip
1537+
1538+
def test_marshal_dump_and_load_with_gzip_coerced
1539+
with_marshable_time_defaults { original_test_marshal_dump_and_load_with_gzip }
1540+
end
1541+
def test_marshal_dump_and_load_via_disk_coerced
1542+
with_marshable_time_defaults { original_test_marshal_dump_and_load_via_disk }
1543+
end
15341544
end
15351545

15361546
private

0 commit comments

Comments
 (0)