Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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.

Replies are listed 'Best First'.
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

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.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2017-06-27 18:09 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (611 votes). Check out past polls.