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

ruby-changes:74387

From: Benoit <ko1@a...>
Date: Tue, 8 Nov 2022 04:06:46 +0900 (JST)
Subject: [ruby-changes:74387] c99e4c4278 (master): Update to ruby/mspec@1e16420

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

From c99e4c427897e82a3419abed894d28705f70fa13 Mon Sep 17 00:00:00 2001
From: Benoit Daloze <eregontp@g...>
Date: Mon, 7 Nov 2022 20:05:18 +0100
Subject: Update to ruby/mspec@1e16420

---
 spec/mspec/tool/tag_from_output.rb | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/spec/mspec/tool/tag_from_output.rb b/spec/mspec/tool/tag_from_output.rb
index ebe13434c2..23a5dc0fb3 100755
--- a/spec/mspec/tool/tag_from_output.rb
+++ b/spec/mspec/tool/tag_from_output.rb
@@ -11,6 +11,11 @@ abort 'Could not find tags directory' unless tags_dir https://github.com/ruby/ruby/blob/trunk/spec/mspec/tool/tag_from_output.rb#L11
 
 output = ARGF.readlines
 
+# Automatically strip datetime of GitHub Actions
+if output.first =~ /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d+Z /
+  output = output.map { |line| line.split(' ', 2).last }
+end
+
 NUMBER = /^\d+\)$/
 ERROR_OR_FAILED = / (ERROR|FAILED)$/
 SPEC_FILE = /^(\/.+_spec\.rb)\:\d+/
@@ -22,11 +27,24 @@ output.slice_before(NUMBER).select { |number, *rest| https://github.com/ruby/ruby/blob/trunk/spec/mspec/tool/tag_from_output.rb#L27
   description = error_line.match(ERROR_OR_FAILED).pre_match
 
   spec_file = rest.find { |line| line =~ SPEC_FILE }
-  unless spec_file
-    warn "Could not find file for:\n#{error_line}"
-    next
+  if spec_file
+    spec_file = spec_file[SPEC_FILE, 1] or raise
+  else
+    if error_line =~ /^(\w+)#(\w+) /
+      module_method = error_line.split(' ', 2).first
+      file = "#{$1.downcase}/#{$2}_spec.rb"
+      spec_file = ['spec/ruby/core', 'spec/ruby/library', *Dir.glob('spec/ruby/library/*')].find { |dir|
+        path = "#{dir}/#{file}"
+        break path if File.exist?(path)
+      }
+    end
+
+    unless spec_file
+      warn "Could not find file for:\n#{error_line}"
+      next
+    end
   end
-  spec_file = spec_file[SPEC_FILE, 1]
+
   prefix = spec_file.index('spec/ruby/') || spec_file.index('spec/truffle/')
   spec_file = spec_file[prefix..-1]
 
-- 
cgit v1.2.3


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

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