diff options
Diffstat (limited to 'tool/test-bundled-gems.rb')
-rw-r--r-- | tool/test-bundled-gems.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tool/test-bundled-gems.rb b/tool/test-bundled-gems.rb index 53c88c196e..d4c45332ab 100644 --- a/tool/test-bundled-gems.rb +++ b/tool/test-bundled-gems.rb @@ -1,6 +1,8 @@ require 'rbconfig' require 'timeout' +github_actions = ENV["GITHUB_ACTIONS"] == "true" + allowed_failures = ENV['TEST_BUNDLED_GEMS_ALLOW_FAILURES'] || '' allowed_failures = allowed_failures.split(',').reject(&:empty?) @@ -13,7 +15,7 @@ File.foreach("#{gem_dir}/bundled_gems") do |line| next if /^\s*(?:#|$)/ =~ line gem = line.split.first next if ARGV.any? {|pat| !File.fnmatch?(pat, gem)} - puts "\nTesting the #{gem} gem" + puts "#{github_actions ? "##[group]" : "\n"}Testing the #{gem} gem" test_command = "#{ruby} -C #{gem_dir}/src/#{gem} -Ilib #{rake} test" first_timeout = 600 # 10min @@ -33,6 +35,7 @@ File.foreach("#{gem_dir}/bundled_gems") do |line| test_command << " 'TESTOPTS=-e /test_stub_value_block_args_5__break_if_not_passed|test_no_method_error_on_unexpected_methods/'" end + print "[command]" if github_actions puts test_command pid = Process.spawn(test_command, "#{/mingw|mswin/ =~ RUBY_PLATFORM ? 'new_' : ''}pgroup": true) {nil => first_timeout, INT: 30, TERM: 10, KILL: nil}.each do |sig, sec| @@ -55,6 +58,7 @@ File.foreach("#{gem_dir}/bundled_gems") do |line| exit_code = $?.exitstatus end end + print "##[endgroup]\n" if github_actions end puts "Failed gems: #{failed.join(', ')}" unless failed.empty? |