thaljef / Pinto

Curate your own repository of Perl modules
https://metacpan.org/module/Pinto::Manual
66 stars 49 forks source link

failing tests #202

Closed saberworks closed 9 years ago

saberworks commented 9 years ago

I installed perl 5.20.2 from source. Then I updated cpan using install CPAN, reload CPAN. Then I attempted to install Pinto. All the dependencies installed correctly with no failing tests or weird output. Then when it's testing Pinto itself, I get this test failure:

t/03-remote/05-timezone.t .............
    #   Failed test 'Add action was successful'
    #   at t/03-remote/05-timezone.t line 33.

    #   Failed test 'Time offset'
    #   at t/03-remote/05-timezone.t line 39.
    #          got: '0'
    #     expected: '10'

    #   Failed test 'User datetime offset'
    #   at t/03-remote/05-timezone.t line 48.
    #          got: '0'
    #     expected: '10'
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>503 Service Temporarily Unavailable</title>
</head><body>
<h1>Service Temporarily Unavailable</h1>
<p>The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.</p>
<hr>
<address>Apache/2.2.25 (Unix) Server at localhost Port 50667</address>
</body></html>
    # Looks like you failed 3 tests of 9.
t/03-remote/05-timezone.t ............. 1/?
#   Failed test 'User vs Local vs UTC time'
#   at t/03-remote/05-timezone.t line 53.
# Looks like you failed 1 test of 1.
t/03-remote/05-timezone.t ............. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests
saberworks commented 9 years ago

I spent some time this morning looking into this further. There are also failures in this test reported on cpantesters, although the exact message is different. I found that the issue is caused by my host being behind an HTTP proxy. This is because the host doesn't have direct access to the internet. I used the following command to set up the proxy servers for cpan:

o conf init /proxy/

However, it is required to set the no_proxy value to include "localhost" otherwise the tests (using LWP) try to go through the http proxy to hit "localhost:" which isn't accessible through the proxy.

It would be nice if the test could detect whether it's going through a proxy, and if so, don't go through the proxy for the localhost connections. If not, at least an option to disable the server tests would be helpful.

thaljef commented 9 years ago

On Tue, Apr 14, 2015 at 11:17 AM, saberworks notifications@github.com wrote:

It would be nice if the test could detect whether it's going through a proxy, and if so, don't go through the proxy for the localhost connections. If not, at least an option to disable the server tests would be helpful.

Regardless of whether there is a proxy, the tests should never need to contact the network. So can we just always override the proxy settings during testing?

Thanks for researching this. It has been eluding me for some time.

saberworks commented 9 years ago

It seems reasonable to me. Instead of messing with environment variables I think you can use no_proxy() method on LWP directly.

thaljef commented 9 years ago

This is the same as #176.

cakirke commented 9 years ago

no proxy in play on my local machine, as a test, i disabled network and get several test suite failures:

all trying to connect to meta.stratopan.com:80 and www.cpan.org:80

my understanding is we need the following:

thaljef commented 9 years ago

Those are release tests, generally not executed by end users. So those aren't really related to this issue.

thaljef commented 9 years ago

This was fixed and released as Pinto-0.09999.