Testing CPAN modules

Tom Hukins tom at eborcom.com
Sat Oct 6 11:04:57 PDT 2007

On Fri, Sep 28, 2007 at 02:47:08PM +0100, tony.x.edwardson at jpmorgan.com wrote:
> Anyone knbow of a way to run the test suites which come with CPAN modules 
> without access to the internet, make or a c compiler ?
> I am trying to get a recent version of perl (5.8.8) installed on 
> production machines which exist in a highly restricted environment.

Rephrasing your query, you have two issues to deal with:
1. Your production servers don't include compilers or other build
tools.  They're production servers, so they should do their intended
jobs, not compile software or run its tests.
2. You don't want to deploy software in production without checking it
seems to work.

> The problem is that the procedures require me to run tests on all of the 
> modules I've introduced on the production box where make and gcc don't 
> exist.

You mention that you have 400 production servers, so presumably you
have some automated way to deploy them.  Can you deploy the production
environment and then install the build tools you need on top of this
environment?  This will let you build and test your code in an
environment that only differs marginally from production.

> Ideally, I'd like to use the test suites that come with each module but I 
> can't use "make test" without make.
> There is "prove" , but not all of the module distributions have a "t" 
> subdirectory - they have a test.pl script instead.

As a heuristic, you could "prove t/*.t test.pl" but this won't work
for modules that have non-standard test procedures defined in their
Makefile.PL, Build.PL or whatever Module::Install uses.  Ziya already
mentioned this in more detail.

> I've played with the CPAN module but I can't find a way to use it without 
> access to make.

How do you deploy other software to these servers?  Do you use a
packaging system?  Could you build packages of the Perl modules you
need?  Again, Ziya mentioned this.

Testing your code, compiling it or building packages of it on
production servers strikes me as a bad idea:  these servers exist to
serve, not to build.  But building packages in a very similar
environment that you can then deploy onto production seems both doable
and sensible.


More information about the MiltonKeynes-pm mailing list