[前][次][番号順一覧][スレッド一覧]

ruby-changes:66151

From: Takashi <ko1@a...>
Date: Wed, 12 May 2021 07:19:04 +0900 (JST)
Subject: [ruby-changes:66151] cc1ea6e023 (master): Run nmake check on Actions (#4487)

https://git.ruby-lang.org/ruby.git/commit/?id=cc1ea6e023

From cc1ea6e0238a36c08a6255a6ac7a68c54ccafa4a Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Tue, 11 May 2021 15:18:44 -0700
Subject: Run nmake check on Actions (#4487)

* Run nmake check on Actions

* Skip tests not working in mswin GitHub Actions

* Override TEMP

* Revert "Skip tests not working in mswin GitHub Actions"

This reverts commit 544d2575fcdf23ae63cd25aa03fce10c28b259f2.

* Revert "Revert "Skip tests not working in mswin GitHub Actions""

This reverts commit e1f8ad7862c9c4be52dc6e1031a004621eb07e6e.

* Fix timeouts

* Skip some more broken tests

* Update windows.yml

* Add a guard for rbasic_spec

* Revert "Update windows.yml"

This reverts commit bc9694b6b3b9594d406378d15ca11723fb052bc8.

* Skip the ensure clause

* Simplify the ensure
---
 .github/workflows/windows.yml                        | 20 +++++++++++++++++---
 spec/ruby/optional/capi/rbasic_spec.rb               |  1 +
 test/resolv/test_dns.rb                              |  1 +
 test/ruby/test_file_exhaustive.rb                    |  1 +
 test/rubygems/test_gem_ext_builder.rb                |  3 +++
 test/rubygems/test_gem_installer.rb                  |  1 +
 test/rubygems/test_gem_resolver_git_specification.rb |  1 +
 tool/test/webrick/test_filehandler.rb                |  1 +
 tool/test/webrick/test_httpproxy.rb                  |  1 +
 9 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index 700b9b9..a8dd64e 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -4,7 +4,7 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/windows.yml#L4
   make:
     strategy:
       matrix:
-        test_task: [test]
+        test_task: [check] # to make job names consistent
         os: [windows-2019]
         vs: [2019]
       fail-fast: false
@@ -62,10 +62,24 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/windows.yml#L62
           nmake extract-extlibs
           nmake
       - name: nmake test
-        timeout-minutes: 30
+        timeout-minutes: 5
         run: |
           call "%VCVARS%"
-          nmake ${{ matrix.test_task }}
+          nmake test
+      - name: nmake test-all
+        timeout-minutes: 60
+        run: |
+          call "%VCVARS%"
+          # %TEMP% is inconsistent with %TMP% and test-all expects they are consistent.
+          # https://github.com/actions/virtual-environments/issues/712#issuecomment-613004302
+          set TMP=%USERPROFILE%\AppData\Local\Temp
+          set TEMP=%USERPROFILE%\AppData\Local\Temp
+          nmake test-all
+      - name: nmake test-spec
+        timeout-minutes: 10
+        run: |
+          call "%VCVARS%"
+          nmake test-spec
       - uses: k0kubun/action-slack@v...
         with:
           payload: |
diff --git a/spec/ruby/optional/capi/rbasic_spec.rb b/spec/ruby/optional/capi/rbasic_spec.rb
index 283e70d..691c425 100644
--- a/spec/ruby/optional/capi/rbasic_spec.rb
+++ b/spec/ruby/optional/capi/rbasic_spec.rb
@@ -1,6 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/rbasic_spec.rb#L1
 require_relative 'spec_helper'
 require_relative 'shared/rbasic'
 load_extension("rbasic")
+return if /mswin/ =~ RUBY_PLATFORM && ENV.key?('GITHUB_ACTIONS') # not working from the beginning
 load_extension("data")
 load_extension("array")
 
diff --git a/test/resolv/test_dns.rb b/test/resolv/test_dns.rb
index d3c4b1f..1f1555f 100644
--- a/test/resolv/test_dns.rb
+++ b/test/resolv/test_dns.rb
@@ -268,6 +268,7 @@ class TestResolvDNS < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/resolv/test_dns.rb#L268
   end
 
   def test_no_server
+    skip if /mswin/ =~ RUBY_PLATFORM && ENV.key?('GITHUB_ACTIONS') # not working from the beginning
     u = UDPSocket.new
     u.bind("127.0.0.1", 0)
     _, port, _, host = u.addr
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index 0ccf993..70966d8 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -1257,6 +1257,7 @@ class TestFileExhaustive < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_file_exhaustive.rb#L1257
     assert_equal(regular_file, File.dirname(regular_file, 0))
     assert_equal(@dir, File.dirname(regular_file, 1))
     assert_equal(File.dirname(@dir), File.dirname(regular_file, 2))
+    return if /mswin/ =~ RUBY_PLATFORM && ENV.key?('GITHUB_ACTIONS') # rootdir and tmpdir are in different drives
     assert_equal(rootdir, File.dirname(regular_file, regular_file.count('/')))
     assert_raise(ArgumentError) {File.dirname(regular_file, -1)}
   end
diff --git a/test/rubygems/test_gem_ext_builder.rb b/test/rubygems/test_gem_ext_builder.rb
index 6bebfa7..b687a08 100644
--- a/test/rubygems/test_gem_ext_builder.rb
+++ b/test/rubygems/test_gem_ext_builder.rb
@@ -106,6 +106,7 @@ install: https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_builder.rb#L106
   end
 
   def test_build_extensions
+    skip if /mswin/ =~ RUBY_PLATFORM && ENV.key?('GITHUB_ACTIONS') # not working from the beginning
     @spec.extensions << 'ext/extconf.rb'
 
     ext_dir = File.join @spec.gem_dir, 'ext'
@@ -141,6 +142,7 @@ install: https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_builder.rb#L142
   end
 
   def test_build_extensions_with_gemhome_with_space
+    skip if /mswin/ =~ RUBY_PLATFORM && ENV.key?('GITHUB_ACTIONS') # not working from the beginning
     new_gemhome = File.join @tempdir, 'gem home'
     File.rename(@gemhome, new_gemhome)
     @gemhome = new_gemhome
@@ -161,6 +163,7 @@ install: https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_ext_builder.rb#L163
         false
       end
     end
+    skip if /mswin/ =~ RUBY_PLATFORM && ENV.key?('GITHUB_ACTIONS') # not working from the beginning
 
     @spec.extensions << 'ext/extconf.rb'
 
diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb
index 88d5490..0d1f2c4 100644
--- a/test/rubygems/test_gem_installer.rb
+++ b/test/rubygems/test_gem_installer.rb
@@ -1482,6 +1482,7 @@ gem 'other', version https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_installer.rb#L1482
 
   def test_install_extension_and_script
     skip "Makefile creation crashes on jruby" if Gem.java_platform?
+    skip if /mswin/ =~ RUBY_PLATFORM && ENV.key?('GITHUB_ACTIONS') # not working from the beginning
 
     @spec = setup_base_spec
     @spec.extensions << "extconf.rb"
diff --git a/test/rubygems/test_gem_resolver_git_specification.rb b/test/rubygems/test_gem_resolver_git_specification.rb
index 4283e02..c2ed1b5 100644
--- a/test/rubygems/test_gem_resolver_git_specification.rb
+++ b/test/rubygems/test_gem_resolver_git_specification.rb
@@ -63,6 +63,7 @@ class TestGemResolverGitSpecification < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_resolver_git_specification.rb#L63
 
   def test_install_extension
     skip if Gem.java_platform?
+    skip if /mswin/ =~ RUBY_PLATFORM && ENV.key?('GITHUB_ACTIONS') # not working from the beginning
     name, _, repository, = git_gem 'a', 1 do |s|
       s.extensions << 'ext/extconf.rb'
     end
diff --git a/tool/test/webrick/test_filehandler.rb b/tool/test/webrick/test_filehandler.rb
index 998e03f..146d8ce 100644
--- a/tool/test/webrick/test_filehandler.rb
+++ b/tool/test/webrick/test_filehandler.rb
@@ -247,6 +247,7 @@ class WEBrick::TestFileHandler < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/tool/test/webrick/test_filehandler.rb#L247
 
   def test_short_filename
     return if File.executable?(__FILE__) # skip on strange file system
+    return if /mswin/ =~ RUBY_PLATFORM && ENV.key?('GITHUB_ACTIONS') # not working from the beginning
 
     config = {
       :CGIInterpreter => TestWEBrick::RubyBin,
diff --git a/tool/test/webrick/test_httpproxy.rb b/tool/test/webrick/test_httpproxy.rb
index 1c2f2fc..66dae6f 100644
--- a/tool/test/webrick/test_httpproxy.rb
+++ b/tool/test/webrick/test_httpproxy.rb
@@ -323,6 +323,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/tool/test/webrick/test_httpproxy.rb#L323
   end if defined?(OpenSSL::SSL)
 
   def test_upstream_proxy
+    return if /mswin/ =~ RUBY_PLATFORM && ENV.key?('GITHUB_ACTIONS') # not working from the beginning
     # Testing GET or POST through the upstream proxy server
     # Note that the upstream proxy server works as the origin server.
     #                                   +------+
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]