Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Private tests - How to setup?

by tachyon-II (Chaplain)
on May 28, 2008 at 21:09 UTC ( #688929=perlquestion: print w/ replies, xml ) Need Help??
tachyon-II has asked for the wisdom of the Perl Monks concerning the following question:

While installing Test::Kwalitee with CPAN (talk about dependencies ~ 40 on top of a default ActiveState build) I noticed the occasional message along the lines:

# private test only to be run by author

I would like to use this mechanism (for kwalitee.t for example) and just want to know if there is a clever built in mechanism or if I just need to use an environment variable mechanism to trigger skip/ok behaviour. I grepped the cpan build directory and could not seem to turn up the code, and did not pay enough attention to which of the large number of modules that were installed were doing it. I have Googled "private tests perl" and "private test scripts perl" and can find snippets of discussion from Chris Dolan leading to dead links.

Comment on Private tests - How to setup?
Download Code
Re: Private tests - How to setup?
by kyle (Abbot) on May 28, 2008 at 21:27 UTC

    I'm guessing the Chris Dolan link you want is Private Regression Tests.

    Chris recommends creating test files such as 00_local_foo.t and adding \d+_local_ to MANIFEST.SKIP.

    I'd probably do something as you say—set an environment variable to tell Test::More whether to skip_all or not. If I were feeling too clever for my own good, I'd check against stuff like the local hostname, username, or whatever.

      Thanks kyle, CardinalNumber and grinder.

Re: Private tests - How to setup?
by CardinalNumber (Prior) on May 28, 2008 at 21:51 UTC
    Backing up your assumption and kyle's comment, for the behavior you're describing (skipping pod coverage tests, etc.), the current recommended practice is to check an environment variable, specifically $ENV{RELEASE_TESTING} and skip_all() based on whether it's true/false. I say 'current recommended practice' because there is no real standard, AFAIK.

    I used to use $ENV{AUTHOR_TESTING} in my distributions but $ENV{RELEASE_TESTING} is the hot new thing decided upon during the Oslo QA Hackathon.

    Update: For quick .t examples, see the Oslo QA Hackathon 2008/Achievements wiki page.
Re: Private tests - How to setup?
by grinder (Bishop) on May 28, 2008 at 22:03 UTC

    On thing the perl-qa list settled on a while back is to put release-specific tests (or, if you like mnemonics, eXtra Tests) in the xt/ directory.

    This effectively moves such tests out of the way of standard builds on end-user machines. Future versions of ExtUtils::MakeMaker and Module::Build will offer a way of running the extra tests in xt/ with a minimum of fuss. (If in fact they haven't already done so; I haven't looked recently).

    • another intruder with the mooring in the heart of the Perl

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://688929]
Approved by moritz
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2014-07-23 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (140 votes), past polls