Your message dated Wed, 13 Jan 2021 21:07:59 +0100
with message-id <[email protected]>
and subject line Re: Bug#873681: ruby-rest-client tests fail if global proxy is
set in environment
has caused the Debian Bug report #873681,
regarding ruby-rest-client tests fail if global proxy is set in environment
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
873681: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=873681
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: ruby-rest-client
Version: 2.0.2-2
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu artful ubuntu-patch autopkgtest
The Ubuntu autopkgtest infrastructure uses an http proxy for Internet
access, which means ruby-rest-client automatically picks up the proxy from
the enviroment and uses it. Unfortunately, the upstream tests don't *pass*
if a global proxy is set.
Attached is a patch that has been applied to Ubuntu to mock the environment
for two autopkgtests that are sensitive to this environment setting.
Thanks,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
[email protected] [email protected]
diff -Nru ruby-rest-client-2.0.2/debian/patches/proxy-proof-tests.patch
ruby-rest-client-2.0.2/debian/patches/proxy-proof-tests.patch
--- ruby-rest-client-2.0.2/debian/patches/proxy-proof-tests.patch
1969-12-31 16:00:00.000000000 -0800
+++ ruby-rest-client-2.0.2/debian/patches/proxy-proof-tests.patch
2017-08-29 21:15:28.000000000 -0700
@@ -0,0 +1,30 @@
+Description: Fix tests to pass cleanly when http_proxy is set in the env
+ An autopkgtest environment may have a global proxy set for access to the
+ Internet. Our tests should not fail if this is the case. Mock the
+ environment so that we're not inadvertently testing the wrong thing.
+Author: Steve Langasek <[email protected]>
+
+Index: ruby-rest-client-2.0.2/spec/unit/request_spec.rb
+===================================================================
+--- ruby-rest-client-2.0.2.orig/spec/unit/request_spec.rb
++++ ruby-rest-client-2.0.2/spec/unit/request_spec.rb
+@@ -579,6 +579,9 @@
+ end
+
+ it "creates a non-proxy class if a proxy url is not given" do
++ allow(ENV).to receive(:[]).with("HTTP_PROXY").and_return(nil)
++ allow(ENV).to receive(:[]).with("http_proxy").and_return(nil)
++ allow(ENV).to receive(:[]).with("NETRC").and_return(nil)
+ expect(@proxy_req.net_http_object('host', 80).proxy?).to be_falsey
+ end
+
+@@ -592,6 +595,9 @@
+ end
+
+ it "sets proxy on a per-request basis" do
++ allow(ENV).to receive(:[]).with("HTTP_PROXY").and_return(nil)
++ allow(ENV).to receive(:[]).with("http_proxy").and_return(nil)
++ allow(ENV).to receive(:[]).with("NETRC").and_return(nil)
+ expect(@proxy_req.net_http_object('some', 80).proxy?).to be_falsey
+
+ req = RestClient::Request.new(:method => :put, :url =>
'http://some/resource', :payload => 'payload', :proxy => 'http://example.com')
diff -Nru ruby-rest-client-2.0.2/debian/patches/series
ruby-rest-client-2.0.2/debian/patches/series
--- ruby-rest-client-2.0.2/debian/patches/series 2017-07-25
23:24:23.000000000 -0700
+++ ruby-rest-client-2.0.2/debian/patches/series 2017-08-29
21:04:31.000000000 -0700
@@ -1,2 +1,3 @@
disable-network-tests.patch
no-git-in-gemspec.patch
+proxy-proof-tests.patch
--- End Message ---
--- Begin Message ---
Version: 2.0.2-3
This was fixed in 2.0.2-3
--- End Message ---