From 9c6987ebd68e185c73eccfe9b197d9833bf56fb1 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 10 May 2021 20:51:12 -0700 Subject: [PATCH 01/12] Run nmake check on Actions --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e8633c57ee4245..3b2be7bb651f91 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -4,7 +4,7 @@ jobs: make: strategy: matrix: - test_task: [test] + test_task: [check] os: [windows-2019] vs: [2019] fail-fast: false @@ -57,7 +57,7 @@ jobs: nmake incs nmake extract-extlibs nmake - - name: nmake test + - name: nmake ${{ matrix.test_task }} timeout-minutes: 30 run: | call "%VCVARS%" From 544d2575fcdf23ae63cd25aa03fce10c28b259f2 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 10 May 2021 21:22:42 -0700 Subject: [PATCH 02/12] Skip tests not working in mswin GitHub Actions --- tool/test/webrick/test_filehandler.rb | 1 + tool/test/webrick/test_httpproxy.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/tool/test/webrick/test_filehandler.rb b/tool/test/webrick/test_filehandler.rb index 998e03f690b5f9..146d8ce792d80d 100644 --- a/tool/test/webrick/test_filehandler.rb +++ b/tool/test/webrick/test_filehandler.rb @@ -247,6 +247,7 @@ def test_unwise_in_path 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 1c2f2fce52c7da..66dae6f6f66910 100644 --- a/tool/test/webrick/test_httpproxy.rb +++ b/tool/test/webrick/test_httpproxy.rb @@ -323,6 +323,7 @@ def test_connect 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. # +------+ From 8f0dc016af68f291bf187764d427925f80ad8926 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 10 May 2021 23:30:20 -0700 Subject: [PATCH 03/12] Override TEMP --- .github/workflows/windows.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 24195ca7ef3f7d..ff0985fb561ecc 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -65,6 +65,10 @@ jobs: timeout-minutes: 30 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 ${{ matrix.test_task }} - uses: k0kubun/action-slack@v2.0.0 with: From e1f8ad7862c9c4be52dc6e1031a004621eb07e6e Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 10 May 2021 23:49:41 -0700 Subject: [PATCH 04/12] Revert "Skip tests not working in mswin GitHub Actions" This reverts commit 544d2575fcdf23ae63cd25aa03fce10c28b259f2. --- tool/test/webrick/test_filehandler.rb | 1 - tool/test/webrick/test_httpproxy.rb | 1 - 2 files changed, 2 deletions(-) diff --git a/tool/test/webrick/test_filehandler.rb b/tool/test/webrick/test_filehandler.rb index 146d8ce792d80d..998e03f690b5f9 100644 --- a/tool/test/webrick/test_filehandler.rb +++ b/tool/test/webrick/test_filehandler.rb @@ -247,7 +247,6 @@ def test_unwise_in_path 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 66dae6f6f66910..1c2f2fce52c7da 100644 --- a/tool/test/webrick/test_httpproxy.rb +++ b/tool/test/webrick/test_httpproxy.rb @@ -323,7 +323,6 @@ def test_connect 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. # +------+ From fae5863c04466b1a7c777491d44f8b8d8e38bad2 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 11 May 2021 00:27:12 -0700 Subject: [PATCH 05/12] Revert "Revert "Skip tests not working in mswin GitHub Actions"" This reverts commit e1f8ad7862c9c4be52dc6e1031a004621eb07e6e. --- tool/test/webrick/test_filehandler.rb | 1 + tool/test/webrick/test_httpproxy.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/tool/test/webrick/test_filehandler.rb b/tool/test/webrick/test_filehandler.rb index 998e03f690b5f9..146d8ce792d80d 100644 --- a/tool/test/webrick/test_filehandler.rb +++ b/tool/test/webrick/test_filehandler.rb @@ -247,6 +247,7 @@ def test_unwise_in_path 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 1c2f2fce52c7da..66dae6f6f66910 100644 --- a/tool/test/webrick/test_httpproxy.rb +++ b/tool/test/webrick/test_httpproxy.rb @@ -323,6 +323,7 @@ def test_connect 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. # +------+ From ab461dd815acfb04d0ef14ffba6c4e4934969789 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 11 May 2021 00:29:11 -0700 Subject: [PATCH 06/12] Fix timeouts --- .github/workflows/windows.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ff0985fb561ecc..a8dd64eb351204 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -4,7 +4,7 @@ jobs: make: strategy: matrix: - test_task: [check] + test_task: [check] # to make job names consistent os: [windows-2019] vs: [2019] fail-fast: false @@ -61,15 +61,25 @@ jobs: nmake incs nmake extract-extlibs nmake - - name: nmake ${{ matrix.test_task }} - timeout-minutes: 30 + - name: nmake test + timeout-minutes: 5 + run: | + call "%VCVARS%" + 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 ${{ matrix.test_task }} + nmake test-all + - name: nmake test-spec + timeout-minutes: 10 + run: | + call "%VCVARS%" + nmake test-spec - uses: k0kubun/action-slack@v2.0.0 with: payload: | From f67b66c120c0f3c4386d302f4ca47985aec8ad9e Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 11 May 2021 01:54:05 -0700 Subject: [PATCH 07/12] Skip some more broken tests --- 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 + 5 files changed, 7 insertions(+) diff --git a/test/resolv/test_dns.rb b/test/resolv/test_dns.rb index d3c4b1f3e93794..1f1555feccd91a 100644 --- a/test/resolv/test_dns.rb +++ b/test/resolv/test_dns.rb @@ -268,6 +268,7 @@ def test_query_ipv4_address_timeout 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 0ccf99312b5f47..70966d83a4a267 100644 --- a/test/ruby/test_file_exhaustive.rb +++ b/test/ruby/test_file_exhaustive.rb @@ -1257,6 +1257,7 @@ def test_dirname 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 6bebfa7a03039a..ff104f28861b3b 100644 --- a/test/rubygems/test_gem_ext_builder.rb +++ b/test/rubygems/test_gem_ext_builder.rb @@ -106,6 +106,7 @@ def test_custom_make_with_options 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 @@ def test_build_extensions 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 @@ -152,6 +154,7 @@ def test_build_extensions_with_gemhome_with_space end def test_build_extensions_install_ext_only + skip if /mswin/ =~ RUBY_PLATFORM && ENV.key?('GITHUB_ACTIONS') # not working from the beginning class << Gem alias orig_install_extension_in_lib install_extension_in_lib diff --git a/test/rubygems/test_gem_installer.rb b/test/rubygems/test_gem_installer.rb index 88d54901eb54bb..0d1f2c4102db27 100644 --- a/test/rubygems/test_gem_installer.rb +++ b/test/rubygems/test_gem_installer.rb @@ -1482,6 +1482,7 @@ def test_find_lib_file_after_install 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 4283e0276555a2..c2ed1b502dc97f 100644 --- a/test/rubygems/test_gem_resolver_git_specification.rb +++ b/test/rubygems/test_gem_resolver_git_specification.rb @@ -63,6 +63,7 @@ def test_install 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 From bc9694b6b3b9594d406378d15ca11723fb052bc8 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 11 May 2021 02:53:53 -0700 Subject: [PATCH 08/12] Update windows.yml --- .github/workflows/windows.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a8dd64eb351204..c7ef6d77788e1f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -66,15 +66,6 @@ jobs: run: | call "%VCVARS%" 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: | From 3823e474749f90f533a99327ff9e6f1a2a17f089 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 11 May 2021 10:47:17 -0700 Subject: [PATCH 09/12] Add a guard for rbasic_spec --- spec/ruby/optional/capi/rbasic_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/ruby/optional/capi/rbasic_spec.rb b/spec/ruby/optional/capi/rbasic_spec.rb index 283e70db706adc..691c4250d29762 100644 --- a/spec/ruby/optional/capi/rbasic_spec.rb +++ b/spec/ruby/optional/capi/rbasic_spec.rb @@ -1,6 +1,7 @@ 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") From e893b6eafca97b508517877843b630aa1c13b836 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 11 May 2021 13:06:55 -0700 Subject: [PATCH 10/12] Revert "Update windows.yml" This reverts commit bc9694b6b3b9594d406378d15ca11723fb052bc8. --- .github/workflows/windows.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c7ef6d77788e1f..a8dd64eb351204 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -66,6 +66,15 @@ jobs: run: | call "%VCVARS%" 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: | From 2c071e2fac0b88d84ffb1fbfb6f467b4ee4acadc Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 11 May 2021 13:08:37 -0700 Subject: [PATCH 11/12] Skip the ensure clause --- test/rubygems/test_gem_ext_builder.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/rubygems/test_gem_ext_builder.rb b/test/rubygems/test_gem_ext_builder.rb index ff104f28861b3b..a9e3f2fa9ec3ab 100644 --- a/test/rubygems/test_gem_ext_builder.rb +++ b/test/rubygems/test_gem_ext_builder.rb @@ -198,6 +198,7 @@ def Gem.install_extension_in_lib refute_path_exists File.join @spec.gem_dir, 'lib', 'a.rb' refute_path_exists File.join @spec.gem_dir, 'lib', 'a', 'b.rb' ensure + return if /mswin/ =~ RUBY_PLATFORM && ENV.key?('GITHUB_ACTIONS') # not working from the beginning class << Gem remove_method :install_extension_in_lib From 636d75b6fe49b66fc53d101978563a30ce68aead Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 11 May 2021 13:09:45 -0700 Subject: [PATCH 12/12] Simplify the ensure --- test/rubygems/test_gem_ext_builder.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/rubygems/test_gem_ext_builder.rb b/test/rubygems/test_gem_ext_builder.rb index a9e3f2fa9ec3ab..b687a0877188c5 100644 --- a/test/rubygems/test_gem_ext_builder.rb +++ b/test/rubygems/test_gem_ext_builder.rb @@ -154,7 +154,6 @@ def test_build_extensions_with_gemhome_with_space end def test_build_extensions_install_ext_only - skip if /mswin/ =~ RUBY_PLATFORM && ENV.key?('GITHUB_ACTIONS') # not working from the beginning class << Gem alias orig_install_extension_in_lib install_extension_in_lib @@ -164,6 +163,7 @@ def Gem.install_extension_in_lib false end end + skip if /mswin/ =~ RUBY_PLATFORM && ENV.key?('GITHUB_ACTIONS') # not working from the beginning @spec.extensions << 'ext/extconf.rb' @@ -198,7 +198,6 @@ def Gem.install_extension_in_lib refute_path_exists File.join @spec.gem_dir, 'lib', 'a.rb' refute_path_exists File.join @spec.gem_dir, 'lib', 'a', 'b.rb' ensure - return if /mswin/ =~ RUBY_PLATFORM && ENV.key?('GITHUB_ACTIONS') # not working from the beginning class << Gem remove_method :install_extension_in_lib