CPAN::Reporter::Smoker::Safer - Turnkey smoking of installed distros
Version 0.04
# Default usage perl -MCPAN::Reporter::Smoker::Safer -e start # Control the 'trust' params for the default filter perl -MCPAN::Reporter::Smoker::Safer -e 'start( safer=>{min_reports=>0, min_days_old=>2} )' # Smoke all installed modules from a specific namespace perl -MCPAN::Reporter::Smoker::Safer -e 'start( safer=>{min_reports=>0, min_days_old=>0, mask=>"/MyFoo::/"} )' # Custom filter (in this case, specific authorid) perl -MCPAN::Reporter::Smoker::Safer -e 'start( safer=>{filter=>sub{$_[1]->pretty_id =~ m#^DAVIDRW/#}} )' # Preview mode - display distros found perl -MCPAN::Reporter::Smoker::Safer -MData::Dumper -e 'print Dumper start(safer=>{preview=>1})'
This is a subclass of CPAN::Reporter::Smoker that will limit the set of tested distributions to ones that are "trusted". This means that the distribution is already installed on the system, and that the new version it has been on CPAN for a certain amount of time, and has already received a certain number of test reporters. The assumption is that is it is safe (as in "safer") to install distributions (and their dependencies) that meet that criteria.
This can be used to run partial smoke testing on a box that normally wouldn't be desired for full smoke testing (i.e. isn't a dedicated/isolated environment). Another potential use is to vet everything before upgrading.
See the CPAN Testers Quick Start guide http://wiki.cpantesters.org/wiki/QuickStart. Once CPAN::Reporter is installed and configured, you should be all set.
There are also some very good hints and notes in the CPAN::Reporter::Smoker documentation.
While in theory this is much safer than full CPAN smoke testing, ALL of the same risks (see CPAN::Reporter::Smoker) still apply:
Smoke testing will download and run programs that other people have uploaded to CPAN. These programs could do *anything* to your system, including deleting everything on it. Do not run CPAN::Reporter::Smoker unless you are prepared to take these risks.
This is an overload of CPAN::Reporter::Smoker::start, and supports the same arguments, with the exception of list which is set internally. In addition, supports the following argument:
list
Hashref with the following possible keys:
Scalar; Defaults to '/./'; Value is passed to CPAN::Shell::expand() for filtering the module list (applies to module names, not distro names).
'/./'
CPAN::Shell::expand()
Code ref; Defaults to "__filter". First argument is the CPAN::Reporter::Smoker::Safer class/object; Second argument is a CPAN::Distribution object. Return value should be 1 (true) to accept, and 0 (false) to reject the distribution.
1
0
filter => sub { my ($safer, $dist) = @_; ... return 1; },
Defaults to 0 (since this involves extra http fetches). This is used by the default filter -- distros are 'trusted' if they have at least this many CPAN testers reports already.
Defaults to 14. This is used by the default filter -- distros are 'trusted' if they were uploaded to CPAN at least this many days ago.
Defaults to [ qr#/perl-5\.#, qr#/mod_perl-\d# ]. This is used by the default filter to exclude any distro whose name (e.g. A/AU/AUTHOR/Foo-Bar-1.23.tar.gz) matches one of these regexes.
[ qr#/perl-5\.#, qr#/mod_perl-\d# ]
Note that the disabled.yml functionality might be more suitable. See CPAN::Reporter::Smoker, CPAN, and CPAN::Distroprefs for more details.
Default false. If true, instead of invoking CPAN::Reporter::Smoker::start() will just return the args (as hashref) that would have been passsed to start(). This is usefull for debugging/testing without kicking off the actual smoke tester.
CPAN::Reporter::Smoker::start()
start()
Default true. This is used by the default filter -- if true, distros are skipped if they were previously tested. CPAN::Reporter::Smoker does this anyways, so doing up front is more efficient. (Use in test suite is the only reason this is provided as a config option.)
Used as the default "filter" code ref.
Excludes any distro who's name (e.g. A/AU/AUTHOR/Foo-Bar-1.23.tar.gz) matches a list of "exclusions".
If "exclude_tested" is true, excludes any distro that was already tested, as determined by CPAN::Reporter::History.
Exclude any distro that was uploaded to CPAN less than "min_days_old" days ago.
Exclude any distro that has less than "min_reports" CPAN Testers reports.
Returns an array ref of dist names (e.g. 'ANDK/CPAN-1.9301.tar.gz' ).
CPAN::Reporter::Smoker::Safer->__installed_dists( $mask, $filter );
mask is optional, and is same value as "mask". filter is optional, and is same value as "filter".
mask
filter
David Westbrook (CPAN: davidrw), <dwestbrook at gmail.com>
<dwestbrook at gmail.com>
Please report any bugs or feature requests to bug-cpan-reporter-smoker-safer at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CPAN-Reporter-Smoker-Safer. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-cpan-reporter-smoker-safer at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc CPAN::Reporter::Smoker::Safer
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=CPAN-Reporter-Smoker-Safer
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/CPAN-Reporter-Smoker-Safer
CPAN Ratings
http://cpanratings.perl.org/d/CPAN-Reporter-Smoker-Safer
Search CPAN
http://search.cpan.org/dist/CPAN-Reporter-Smoker-Safer
http://cpantesters.org - CPAN Testers site
http://groups.google.com/group/perl.cpan.testers.discuss/browse_thread/thread/4ae7f4960beda1d4 - The 1/2009 thread with initial discussion for this module.
CPAN
CPAN::Reporter
CPAN::Reporter::Smoker
The cpan-testers-discuss mailling list for supporting and enhancing the concept.
Copyright 2009 David Westbrook, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install CPAN::Reporter::Smoker::Safer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CPAN::Reporter::Smoker::Safer
CPAN shell
perl -MCPAN -e shell install CPAN::Reporter::Smoker::Safer
For more information on module installation, please visit the detailed CPAN module installation guide.