[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [DRE-maint] Bug#684421: FTBFS: tests require internet connectivity



Felix Geyer dijo [Thu, Aug 09, 2012 at 09:50:42PM +0200]:
> Source: ruby-net-http-persistent
> Version: 2.7-1
> Severity: serious
> Tags: sid, wheezy
> Justification: fails to build from source
> 
> This package requires internet connectivity for its test suite
> to pass. Package builds should not rely on external network
> connectivity, but should be self-contained.
> 
> Just removing the three affected methods from test/test_net_http_persistent.rb
> seems to work but I'm not sure if that's the right thing to do.

Hi Felix,

Thanks for the report - I also am not sure of the action to take, so
I'm asking the rest of the team for input here. Looking at the source,
I see quite often the mention of:

    c = @http.connection_for @uri

where @uri is often defined as 'https://example.com/path'. I am
surprised the tests failed for you only three times — How are you
checking for network connectivity? Just running in an environment with
no networking defined? FWIW, I tested the build killing my default
gateway, and the tests now succeed (or are skipped).

It would be good to build with network access. But it is sometimes
impossible. And the network is a changing thing outside our
control. So, yes, not having network access should not make the test
fail - and the only way out is to report it as such. 

FWIW, I added the patch I am attaching here, that would solve the bug,
to the Git repository. Feel free to upload if you think it's right.
Index: ruby-net-http-persistent/test/test_net_http_persistent.rb
===================================================================
--- ruby-net-http-persistent.orig/test/test_net_http_persistent.rb	2012-07-25 17:37:02.000000000 -0500
+++ ruby-net-http-persistent/test/test_net_http_persistent.rb	2012-08-09 18:45:55.000000000 -0500
@@ -354,6 +354,7 @@
   end
 
   def test_connection_for_http_class_with_fakeweb
+    skip 'No network access can be assumed at Debian package build time'
     Object.send :const_set, :FakeWeb, nil
     c = @http.connection_for @uri
     assert_instance_of Net::HTTP, c
@@ -364,6 +365,7 @@
   end
 
   def test_connection_for_http_class_with_webmock
+    skip 'No network access can be assumed at Debian package build time'
     Object.send :const_set, :WebMock, nil
     c = @http.connection_for @uri
     assert_instance_of Net::HTTP, c
@@ -385,6 +387,7 @@
   end
 
   def test_connection_for_no_ssl_reuse
+    skip 'No network access can be assumed at Debian package build time'
     @http.reuse_ssl_sessions = false
     @http.open_timeout = 123
     @http.read_timeout = 321

Attachment: signature.asc
Description: Digital signature


Reply to: