Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Silence CPAN Testers on obviously broken platforms?

by Tux (Abbot)
on Nov 19, 2012 at 07:23 UTC ( #1004478=note: print w/replies, xml ) Need Help??

in reply to Silence CPAN Testers on obviously broken platforms?

Make sure Makefile.PL (or whatever build system you use) exits with zero status

E.g. When one needs a $UNIFY environmental variable for a module to work, add this in top of your Makefile.PL:

# Be kind to testers, not verbose if (exists $ENV{AUTOMATED_TESTING} and $ENV{AUTOMATED_TESTING}) { exists $ENV{UNIFY} or exit 0; }

Of course you can make the expression as complicated as you wish :)

Note that the CPAN Testers Reports will show "UNKNOWN" instead of "FAIL" and the matrix will show orange instead of red.

Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^2: Silence CPAN Testers on obviously broken platforms?
by tinita (Parson) on Nov 19, 2012 at 13:27 UTC
    don't you rather mean "exit with non-zero status"? zero means success. if you want to get an UNKNOWN report, you shouldn't return zero...

      Nope, see

      exit 0 means Makefile.PL succeeded , so rating could PASS ,FAIL, or UNKNOWN, depends on subsequent steps

      exit 2 means Makefile.PL died , so rating could be FAIL or NA depending on message

      exit 0 and 'Makefile' not created , rating is UNKNOWN

      exit 0 and 'Makefile' created, rating depends 'make' and 'make test' to determine PASS or FAIL

      Now at one point the cpan testers reporting service mixed up these conventions I described, started treating NA as FAIL and UNKNOWN as NA or some such mix of results (not important now)...

      So follow CPANAuthorNotes, to avoid FAIL, exit 0 to get UNKNOWN, or Devel::AssertOS to get NA

      UNKNOWN is safer than NA, cause some Win32 modules can run on linux, and some day they might all run on linux :)

      NA is like the faulty practice of parsing user-agent-string or testing browser version details to determine if the client supports cookies and ajax

      UNKNOWN is like trying to set a cookie to see if cookies are supported or checking if document.XMLHttpRequest is available to know if ajax is supported

        Excellent summary, that somehow derives a greater degree of clarity out of the CPAN Testers documentation than the documentation itself manages. This thread just got added to my Personal Nodelet. :)


      No, the FAQ explicitly states:

      "How can I stop getting FAIL reports for missing libraries or other non-Perl dependencies?"

      If you have some special dependencies and don't want to get CPAN Testers reports if a dependency is not available, just exit from the Makefile.PL or Build.PL normally (with an exit code of 0) before the Makefile or Build file is created.

      exit 0 unless some_dependency_is_met ();

      Enjoy, Have FUN! H.Merijn

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004478]
[Corion]: Also, I think the OPs problem is on their intranet and not on the internet (also, they should likely use WWW::Mechanize instead, which knows about cookie)
[1nickt]: yes, could be.
[1nickt]: I don;t see the link , definitely, after reloading the node
[1nickt]: Is it possible to disable it?
[Discipulus]: if you mean [download] after the code it is there 1nickt
[1nickt]: yes, Corion sees it too, and I see it when not logged in.
[Corion]: I think you can disable download links in your settings?
[1nickt]: Looking in settings to see if I disabled it in my profile ...
[1nickt]: There is "Don;t show embedded d/l links" in Display settings. It is unchecked.
[1nickt]: Oh, there is a minimum lines setting!

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2017-05-23 18:17 GMT
Find Nodes?
    Voting Booth?