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

Re^2: Improving the quality of my modules

by davido (Cardinal)
on Aug 14, 2015 at 16:58 UTC ( #1138611=note: print w/replies, xml ) Need Help??

in reply to Re: Improving the quality of my modules
in thread Improving the quality of my modules

If you are using Test::Perl::Critic, please be sure to make the tests only run if some environment variable such as RELEASE_TESTING is set. There are a couple of reasons for this.

First, Perl::Critic takes time, and what it tests is not likely to actually change from the time you test your release to the time it gets on a user's system. So there's no good reason to tie up user install time testing what cannot have changed since you built the distribution.

Second, it is possible that others have a global Perl::Critic config file set that alter what Perl::Critic looks for. You could discover your tests are suddenly failing on those user's systems, not because the code has changed, but because the test's behavior has changed. Conversely, if you have your own .perlcriticrc, and if it doesn't ship with the distribution, then what you are testing will again be different from what the tests do on a typical user's system.

For these reasons it's wise to not cause a test suite failure based on Test::Perl::Critic running on user's systems. The best approach is to only run it when you are preparing a release.


  • Comment on Re^2: Improving the quality of my modules

Replies are listed 'Best First'.
Re^3: Improving the quality of my modules
by stevieb (Canon) on Aug 15, 2015 at 01:36 UTC

    This is good advice. It's why I run it on the side outside of the test suite.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1138611]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2020-10-29 17:50 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (274 votes). Check out past polls.