1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[bundler/bundler] Parallelize test suite

https://github.com/bundler/bundler/commit/23007cb107
This commit is contained in:
David Rodríguez 2019-01-24 13:28:02 -03:00 committed by Hiroshi SHIBATA
parent ede77d82e7
commit ace88852f2
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
4 changed files with 22 additions and 5 deletions

View file

@ -57,7 +57,10 @@ RSpec.describe Bundler::Source do
let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "< 1.5") } let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "< 1.5") }
context "with color", :no_color_tty do context "with color", :no_color_tty do
before { Bundler.ui = Bundler::UI::Shell.new } before do
allow($stdout).to receive(:tty?).and_return(true)
Bundler.ui = Bundler::UI::Shell.new
end
it "should return a string with the spec name and version and locked spec version" do it "should return a string with the spec name and version and locked spec version" do
expect(subject.version_message(spec)).to eq("nokogiri >= 1.6\e[32m (was < 1.5)\e[0m") expect(subject.version_message(spec)).to eq("nokogiri >= 1.6\e[32m (was < 1.5)\e[0m")
@ -78,7 +81,10 @@ RSpec.describe Bundler::Source do
let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "1.7.0") } let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "1.7.0") }
context "with color", :no_color_tty do context "with color", :no_color_tty do
before { Bundler.ui = Bundler::UI::Shell.new } before do
allow($stdout).to receive(:tty?).and_return(true)
Bundler.ui = Bundler::UI::Shell.new
end
it "should return a string with the locked spec version in yellow" do it "should return a string with the locked spec version in yellow" do
expect(subject.version_message(spec)).to eq("nokogiri 1.6.1\e[33m (was 1.7.0)\e[0m") expect(subject.version_message(spec)).to eq("nokogiri 1.6.1\e[33m (was 1.7.0)\e[0m")
@ -99,7 +105,10 @@ RSpec.describe Bundler::Source do
let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "1.7.0") } let(:locked_gem) { double(:locked_gem, :name => "nokogiri", :version => "1.7.0") }
context "with color", :no_color_tty do context "with color", :no_color_tty do
before { Bundler.ui = Bundler::UI::Shell.new } before do
allow($stdout).to receive(:tty?).and_return(true)
Bundler.ui = Bundler::UI::Shell.new
end
it "should return a string with the locked spec version in green" do it "should return a string with the locked spec version in green" do
expect(subject.version_message(spec)).to eq("nokogiri 1.7.1\e[32m (was 1.7.0)\e[0m") expect(subject.version_message(spec)).to eq("nokogiri 1.7.1\e[32m (was 1.7.0)\e[0m")

View file

@ -58,7 +58,7 @@ RSpec.describe "Bundler.load" do
end end
it "does not find a Gemfile above the testing directory" do it "does not find a Gemfile above the testing directory" do
bundler_gemfile = tmp.join("../Gemfile") bundler_gemfile = Pathname.new(__dir__).join("../../Gemfile")
unless File.exist?(bundler_gemfile) unless File.exist?(bundler_gemfile)
FileUtils.touch(bundler_gemfile) FileUtils.touch(bundler_gemfile)
@remove_bundler_gemfile = true @remove_bundler_gemfile = true

View file

@ -42,7 +42,14 @@ module Spec
end end
def tmp(*path) def tmp(*path)
root.join("tmp", *path) root.join("tmp", scope, *path)
end
def scope
test_number = ENV["TEST_ENV_NUMBER"]
return "" if test_number.nil?
test_number.empty? ? "1" : test_number
end end
def home(*path) def home(*path)

View file

@ -8,6 +8,7 @@ module Spec
module Rubygems module Rubygems
DEV_DEPS = { DEV_DEPS = {
"automatiek" => "~> 0.2.0", "automatiek" => "~> 0.2.0",
"parallel_tests" => "~> 2.29",
"rake" => "~> 12.0", "rake" => "~> 12.0",
"ronn" => "~> 0.7.3", "ronn" => "~> 0.7.3",
"rspec" => "~> 3.8", "rspec" => "~> 3.8",