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

ruby-changes:70330

From: David <ko1@a...>
Date: Mon, 20 Dec 2021 06:50:07 +0900 (JST)
Subject: [ruby-changes:70330] 72db2e00d4 (master): [rubygems/rubygems] Error tracing should be printed to stderr

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

From 72db2e00d4edb7a0e316a5979316595a67069d97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Sun, 19 Dec 2021 15:31:53 +0100
Subject: [rubygems/rubygems] Error tracing should be printed to stderr

https://github.com/rubygems/rubygems/commit/23178f7d7b
---
 lib/bundler/ui/shell.rb                         | 2 +-
 spec/bundler/install/gems/compact_index_spec.rb | 3 ++-
 spec/bundler/realworld/mirror_probe_spec.rb     | 5 ++++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/bundler/ui/shell.rb b/lib/bundler/ui/shell.rb
index 17777af4acb..384752a340a 100644
--- a/lib/bundler/ui/shell.rb
+++ b/lib/bundler/ui/shell.rb
@@ -81,7 +81,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/ui/shell.rb#L81
       def trace(e, newline = nil, force = false)
         return unless debug? || force
         msg = "#{e.class}: #{e.message}\n#{e.backtrace.join("\n  ")}"
-        tell_me(msg, nil, newline)
+        tell_err(msg, nil, newline)
       end
 
       def silence(&blk)
diff --git a/spec/bundler/install/gems/compact_index_spec.rb b/spec/bundler/install/gems/compact_index_spec.rb
index 0cee69f702d..66f755c18f6 100644
--- a/spec/bundler/install/gems/compact_index_spec.rb
+++ b/spec/bundler/install/gems/compact_index_spec.rb
@@ -922,7 +922,8 @@ The checksum of /versions does not match the checksum provided by the server! So https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gems/compact_index_spec.rb#L922
             Gem::Dependency.new("activerecord", "= 2.3.2"),
             Gem::Dependency.new("actionmailer", "= 2.3.2"),
             Gem::Dependency.new("activeresource", "= 2.3.2")]
-    expect(out).to include(<<-E.strip).and include("rails-2.3.2 from rubygems remote at #{source_uri}/ has either corrupted API or lockfile dependencies")
+    expect(out).to include("rails-2.3.2 from rubygems remote at #{source_uri}/ has either corrupted API or lockfile dependencies")
+    expect(err).to include(<<-E.strip)
 Bundler::APIResponseMismatchError: Downloading rails-2.3.2 revealed dependencies not in the API or the lockfile (#{deps.map(&:to_s).join(", ")}).
 Either installing with `--full-index` or running `bundle update rails` should fix the problem.
     E
diff --git a/spec/bundler/realworld/mirror_probe_spec.rb b/spec/bundler/realworld/mirror_probe_spec.rb
index 84d6a9c7824..b5aaf676e99 100644
--- a/spec/bundler/realworld/mirror_probe_spec.rb
+++ b/spec/bundler/realworld/mirror_probe_spec.rb
@@ -89,7 +89,10 @@ RSpec.describe "fetching dependencies with a not available mirror", :realworld = https://github.com/ruby/ruby/blob/trunk/spec/bundler/realworld/mirror_probe_spec.rb#L89
       bundle :install, :artifice => nil, :raise_on_error => false
 
       expect(out).to include "Fetching source index from #{mirror}/"
-      expect(err.split("\n").count).to eq(4)
+      expect(err).to include "Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from #{mirror}/ due to underlying error <Errno::ECONNREFUSED: Failed to open TCP connection to #{host}:#{@mirror_port} (Connection refused - connect(2)"
+      expect(err).to include "Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from #{mirror}/ due to underlying error <Errno::ECONNREFUSED: Failed to open TCP connection to #{host}:#{@mirror_port} (Connection refused - connect(2)"
+      expect(err).to include "Retrying fetcher due to error (4/4): Bundler::HTTPError Could not fetch specs from #{mirror}/ due to underlying error <Errno::ECONNREFUSED: Failed to open TCP connection to #{host}:#{@mirror_port} (Connection refused - connect(2)"
+      expect(err).to include "Could not fetch specs from #{mirror}/ due to underlying error <Errno::ECONNREFUSED: Failed to open TCP connection to #{host}:#{@mirror_port} (Connection refused - connect(2)"
     end
   end
 
-- 
cgit v1.2.1


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

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