summaryrefslogtreecommitdiff
path: root/tool/test-bundled-gems.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-08-07 18:32:24 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-08-07 18:32:24 +0900
commit6e60fc29453603270ebdf79f4b37ec6544a602cc (patch)
tree9792295c75e0291c21e0fd5707d3fc3772d48aac /tool/test-bundled-gems.rb
parentac7986f46a1fc5686b006625a16a9ff62579efe7 (diff)
downloadruby-6e60fc29453603270ebdf79f4b37ec6544a602cc.tar.gz
Group commands on GitHub Actions
Diffstat (limited to 'tool/test-bundled-gems.rb')
-rw-r--r--tool/test-bundled-gems.rb6
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?