diff options
| author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2025-05-22 15:27:34 +0900 |
|---|---|---|
| committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2025-05-22 18:32:10 +0900 |
| commit | 5862be0e89260e597d3dd3d350e7ecb40ee62cce (patch) | |
| tree | 60706984d8aa29de4f63a3dc6972cb76dc178b44 | |
| parent | b7aca78cee41f59d7724c9fff7805dcb4f9411e1 (diff) | |
Skip failing tests with mingw platform
https://github.com/ruby/ruby/actions/runs/15159221855/job/42621232822?pr=13397
```
1)
File.atime returns the last access time for the named file with microseconds FAILED
Expected 0 == 123456
to be truthy but was false
D:/a/ruby/ruby/src/spec/ruby/core/file/atime_spec.rb:26:in `block (3 levels) in <top (required)>'
D:/a/ruby/ruby/src/spec/ruby/core/file/atime_spec.rb:3:in `<top (required)>'
2)
File.ctime returns the change time for the named file (the time at which directory information about the file was changed, not the file itself) with microseconds. FAILED
Expected 0 > 0
to be truthy but was false
D:/a/ruby/ruby/src/spec/ruby/core/file/ctime_spec.rb:21:in `block (3 levels) in <top (required)>'
D:/a/ruby/ruby/src/spec/ruby/core/file/ctime_spec.rb:3:in `<top (required)>'
3)
File.utime sets the access and modification time of each file FAILED
Expected 2025-05-21 10:30:54 +0000
to be within 2025-05-21 10:30:54 +0000 +/- 0.0001
D:/a/ruby/ruby/src/spec/ruby/core/file/utime_spec.rb:25:in `block (2 levels) in <top (required)>'
D:/a/ruby/ruby/src/spec/ruby/core/file/utime_spec.rb:3:in `<top (required)>'
4)
File.mtime returns the modification Time of the file with microseconds FAILED
Expected 0 == 123456
to be truthy but was false
D:/a/ruby/ruby/src/spec/ruby/core/file/mtime_spec.rb:25:in `block (3 levels) in <top (required)>'
D:/a/ruby/ruby/src/spec/ruby/core/file/mtime_spec.rb:3:in `<top (required)>'
```
It may be fixed with https://github.com/ruby/ruby/commit/7aea269b89bd7024bcacb7fe7d4ddb0be2f215af.
But Ruby 3.2 is now security maintenance status. We can't backport it.
| -rw-r--r-- | spec/ruby/core/file/atime_spec.rb | 2 | ||||
| -rw-r--r-- | spec/ruby/core/file/ctime_spec.rb | 2 | ||||
| -rw-r--r-- | spec/ruby/core/file/mtime_spec.rb | 2 | ||||
| -rw-r--r-- | spec/ruby/core/file/utime_spec.rb | 26 |
4 files changed, 17 insertions, 15 deletions
diff --git a/spec/ruby/core/file/atime_spec.rb b/spec/ruby/core/file/atime_spec.rb index 1b47576e6b..3df258016c 100644 --- a/spec/ruby/core/file/atime_spec.rb +++ b/spec/ruby/core/file/atime_spec.rb @@ -15,7 +15,7 @@ describe "File.atime" do File.atime(@file).should be_kind_of(Time) end - platform_is :linux, :windows do + platform_is :linux do unless ENV.key?('TRAVIS') # https://bugs.ruby-lang.org/issues/17926 ## NOTE also that some Linux systems disable atime (e.g. via mount params) for better filesystem speed. it "returns the last access time for the named file with microseconds" do diff --git a/spec/ruby/core/file/ctime_spec.rb b/spec/ruby/core/file/ctime_spec.rb index d17ba1a77f..9b7ab272ff 100644 --- a/spec/ruby/core/file/ctime_spec.rb +++ b/spec/ruby/core/file/ctime_spec.rb @@ -14,7 +14,7 @@ describe "File.ctime" do File.ctime(@file).should be_kind_of(Time) end - platform_is :linux, :windows do + platform_is :linux do it "returns the change time for the named file (the time at which directory information about the file was changed, not the file itself) with microseconds." do supports_subseconds = Integer(`stat -c%z '#{__FILE__}'`[/\.(\d{1,6})/, 1], 10) if supports_subseconds != 0 diff --git a/spec/ruby/core/file/mtime_spec.rb b/spec/ruby/core/file/mtime_spec.rb index 5304bbf057..6c43265a2c 100644 --- a/spec/ruby/core/file/mtime_spec.rb +++ b/spec/ruby/core/file/mtime_spec.rb @@ -15,7 +15,7 @@ describe "File.mtime" do File.mtime(@filename).should be_close(@mtime, TIME_TOLERANCE) end - platform_is :linux, :windows do + platform_is :linux do unless ENV.key?('TRAVIS') # https://bugs.ruby-lang.org/issues/17926 it "returns the modification Time of the file with microseconds" do supports_subseconds = Integer(`stat -c%y '#{__FILE__}'`[/\.(\d{1,6})/, 1], 10) diff --git a/spec/ruby/core/file/utime_spec.rb b/spec/ruby/core/file/utime_spec.rb index 0b0e4f979c..cf7a0aec20 100644 --- a/spec/ruby/core/file/utime_spec.rb +++ b/spec/ruby/core/file/utime_spec.rb @@ -19,18 +19,20 @@ describe "File.utime" do rm_r @file1, @file2 end - it "sets the access and modification time of each file" do - File.utime(@atime, @mtime, @file1, @file2) - if @time_is_float - File.atime(@file1).should be_close(@atime, 0.0001) - File.mtime(@file1).should be_close(@mtime, 0.0001) - File.atime(@file2).should be_close(@atime, 0.0001) - File.mtime(@file2).should be_close(@mtime, 0.0001) - else - File.atime(@file1).to_i.should be_close(@atime.to_i, TIME_TOLERANCE) - File.mtime(@file1).to_i.should be_close(@mtime.to_i, TIME_TOLERANCE) - File.atime(@file2).to_i.should be_close(@atime.to_i, TIME_TOLERANCE) - File.mtime(@file2).to_i.should be_close(@mtime.to_i, TIME_TOLERANCE) + platform_is_not :windows do + it "sets the access and modification time of each file" do + File.utime(@atime, @mtime, @file1, @file2) + if @time_is_float + File.atime(@file1).should be_close(@atime, 0.0001) + File.mtime(@file1).should be_close(@mtime, 0.0001) + File.atime(@file2).should be_close(@atime, 0.0001) + File.mtime(@file2).should be_close(@mtime, 0.0001) + else + File.atime(@file1).to_i.should be_close(@atime.to_i, TIME_TOLERANCE) + File.mtime(@file1).to_i.should be_close(@mtime.to_i, TIME_TOLERANCE) + File.atime(@file2).to_i.should be_close(@atime.to_i, TIME_TOLERANCE) + File.mtime(@file2).to_i.should be_close(@mtime.to_i, TIME_TOLERANCE) + end end end |
