Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Tests failing for third party server lapses

by Sixtease (Friar)
on Nov 04, 2008 at 07:45 UTC ( #721301=perlquestion: print w/replies, xml ) Need Help??
Sixtease has asked for the wisdom of the Perl Monks concerning the following question:

Dear friends,

A CPAN module of mine (XML::Entities) depends on downloading entity definitions from a third party server ( upon build. Of course, this fails when the download times out. The result is that tests on CPANtesters fail even though the module as such works OK.

What do you think can be done about this? People get wrong impression that the module is broken but on the other hand, the install can fail any time (when are overloaded).

Do you have an advice?

use strict; use warnings; print "Just Another Perl Hacker\n";
  • Comment on Tests failing for third party server lapses

Replies are listed 'Best First'.
Re: Tests failing for third party server lapses
by moritz (Cardinal) on Nov 04, 2008 at 07:56 UTC
    Modify your Makefile.PL so that it downloads the definitions file, and if that fails prints out a nice, informative error message and refuses to write a Makefile.

    That way you will get NA reports instead of FAIL reports, and your users will know what's going on.

      This is great, thank you, exactly what I needed to hear. :-)

      Just how exactly do I make it produce NA instead of FAIL? Link to docs will do.

      use strict; use warnings; print "Just Another Perl Hacker\n";
Re: Tests failing for third party server lapses
by brian_d_foy (Abbot) on Nov 04, 2008 at 10:14 UTC

    Can you bundle a minimal set of files just for testing? How about mirroring the files that you need on another server (say, like a Google Code project)?

    Also, you can skip tests if you don't have everything that you need to test. I wouldn't refuse to write a Makefile because that stops everyone from installing the source even though the module probably still works. Print out a nice message saying they need to download some files later and still test what you can.

    brian d foy <>
    Subscribe to The Perl Review
Re: Tests failing for third party server lapses
by mje (Curate) on Nov 04, 2008 at 13:12 UTC

    As others have said, I'd try and include some of the test files with your distribution or add a second place to get them in case of busy servers. However, you are still best skipping tests where you cannot perform the test rather than failing to generate a Makefile since the person installing will not be able to install even if it would have worked.

    I'm not smoke testing currently but I was until a few weeks ago. A number of distributions I tested which required HTTP access failed because they paid no attention to my http_proxy environment variable and hence could not get HTTP to work e.g., they did not call env_proxy in LWP.

Re: Tests failing for third party server lapses
by Gurft (Novice) on Nov 05, 2008 at 16:16 UTC
    The idea of having to go out and download something in order for your module to build always seems like a "bad idea" to me, especially for users that are installing your module onto systems that do not have internet access (like those of us living behind corporate firewalls)

    I would try to include the latest entity definitions from w3 as of the version of the module you're releasing and provide the user the option to download the latest/greatest or provide documentation of how to manually go get it instead of making it part of the automated build process.

      There was discussion about this earlier. People adviced me to have the entities always downloaded to 1) avoid having to keep a list of entities up to date and 2) keep the module significantly smaller.

      I'm now thinking of creating another module, which would only contain the definitions. But then I'd need to depend either on it or on www access. Can something like that be represented?

      use strict; use warnings; print "Just Another Perl Hacker\n";

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://721301]
Approved by almut
Front-paged by Arunbear
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2018-06-22 18:42 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (124 votes). Check out past polls.