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

ruby-changes:60228

From: Benoit <ko1@a...>
Date: Sat, 29 Feb 2020 03:08:01 +0900 (JST)
Subject: [ruby-changes:60228] 5d21050182 (master): Update to ruby/mspec@a514ad7

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

From 5d210501825e1682e68cbfc2be424fc339f382fa Mon Sep 17 00:00:00 2001
From: Benoit Daloze <eregontp@g...>
Date: Fri, 28 Feb 2020 19:07:14 +0100
Subject: Update to ruby/mspec@a514ad7


diff --git a/spec/mspec/lib/mspec/helpers/tmp.rb b/spec/mspec/lib/mspec/helpers/tmp.rb
index 1677fb4..5062991 100644
--- a/spec/mspec/lib/mspec/helpers/tmp.rb
+++ b/spec/mspec/lib/mspec/helpers/tmp.rb
@@ -3,11 +3,9 @@ https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/helpers/tmp.rb#L3
 # should clean up any temporary files created so that the temp
 # directory is empty when the process exits.
 
-SPEC_TEMP_DIR = File.expand_path(ENV["SPEC_TEMP_DIR"] || "rubyspec_temp")
-
-SPEC_TEMP_UNIQUIFIER = "0"
-
 SPEC_TEMP_DIR_PID = Process.pid
+SPEC_TEMP_DIR = File.expand_path(ENV["SPEC_TEMP_DIR"] || "rubyspec_temp/#{SPEC_TEMP_DIR_PID}")
+SPEC_TEMP_UNIQUIFIER = "0"
 
 at_exit do
   begin
@@ -31,7 +29,7 @@ all specs are cleaning up temporary files: https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/helpers/tmp.rb#L29
 end
 
 def tmp(name, uniquify = true)
-  Dir.mkdir SPEC_TEMP_DIR unless Dir.exist? SPEC_TEMP_DIR
+  mkdir_p SPEC_TEMP_DIR unless Dir.exist? SPEC_TEMP_DIR
 
   if uniquify and !name.empty?
     slash = name.rindex "/"
diff --git a/spec/mspec/lib/mspec/runner/parallel.rb b/spec/mspec/lib/mspec/runner/parallel.rb
index 7428b33..6a9ecd1 100644
--- a/spec/mspec/lib/mspec/runner/parallel.rb
+++ b/spec/mspec/lib/mspec/runner/parallel.rb
@@ -15,7 +15,7 @@ class ParallelRunner https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/runner/parallel.rb#L15
       @output_files << name
 
       env = {
-        "SPEC_TEMP_DIR" => "rubyspec_temp_#{i}",
+        "SPEC_TEMP_DIR" => "#{SPEC_TEMP_DIR}_#{i}",
         "MSPEC_MULTI" => i.to_s
       }
       command = @argv + ["-fy", "-o", name]
diff --git a/spec/mspec/spec/helpers/tmp_spec.rb b/spec/mspec/spec/helpers/tmp_spec.rb
index afadc7f..4dcf629 100644
--- a/spec/mspec/spec/helpers/tmp_spec.rb
+++ b/spec/mspec/spec/helpers/tmp_spec.rb
@@ -4,7 +4,7 @@ require 'mspec/helpers' https://github.com/ruby/ruby/blob/trunk/spec/mspec/spec/helpers/tmp_spec.rb#L4
 
 describe Object, "#tmp" do
   before :all do
-    @dir = "#{File.expand_path(Dir.pwd)}/rubyspec_temp"
+    @dir = SPEC_TEMP_DIR
   end
 
   it "returns a name relative to the current working directory" do
diff --git a/spec/mspec/tool/sync/sync-rubyspec.rb b/spec/mspec/tool/sync/sync-rubyspec.rb
index d782774..72572e2 100644
--- a/spec/mspec/tool/sync/sync-rubyspec.rb
+++ b/spec/mspec/tool/sync/sync-rubyspec.rb
@@ -158,7 +158,8 @@ def test_new_specs https://github.com/ruby/ruby/blob/trunk/spec/mspec/tool/sync/sync-rubyspec.rb#L158
   require "yaml"
   Dir.chdir(SOURCE_REPO) do
     workflow = YAML.load_file(".github/workflows/ci.yml")
-    versions = workflow.dig("jobs", "test", "strategy", "matrix", "ruby")
+    job_name = MSPEC ? "test" : "specs"
+    versions = workflow.dig("jobs", job_name, "strategy", "matrix", "ruby")
     versions = versions.grep(/^\d+\./) # Test on MRI
     min_version, max_version = versions.minmax
 
-- 
cgit v0.10.2


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

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