CPAN Testers is only made possible with the support of our sponsors.
For more information on sponsoring, please visit the I CPAN Testers website.

Upgrade Notice

The CPAN Testers Wiki site has been upgraded since you last accessed the site. Please press the F5 key or CTRL-R to refresh your browser cache to use the latest javascript and CSS files.

Smoke Testing

For software testing practice, smoke tests is a term to designate the possibility to execute automated tests without need of human intervention.

CPAN::Reporter::Smoker will let you do that but the configuration can be quite involving.

First of all, doing smoke tests can be a dangerous thing, specially because you are downloading code from people you don't know (probably) and don't have the slightest idea what the code does. I never heard about somebody that upload malicious code to CPAN, but while that could happen, it is usually ugly bugs that are a risk to damage the smoker machine or even your LAN.

So, to avoid that, the best is to create a Virtual Machine (VM). There are several options to create one. As the guest OS, you can use any one that supports Perl.

Which OS is better? Well, Perl runs better in UNIX-like OS's, that is not exactly a secret. Doing smoke tests are far easier at a UNIX-like box. Tests will not usually hang like using Microsoft Windows or Cygwin. Of course there are some modules that runs exclusively in some OS, and you can do some good to add more tests in those "weirdos" instead of a UNIX-like OS.

After that, consider limiting the smoker machine access to your LAN and to the Internet. Smoking tests are also possible by using an HTTP/HTTPS proxy. CPAN can work behind a HTTP/HTTPS proxy if you need to use one, as CPAN-Reporter does.

And here is a list (for those who like them) of things to do to setup your smoke machine:

  1. Provide a update version of OpenSSL development files. That configuration will vary from your operational system, but OpenSSL is required by default by CPAN-Reporter for sending the tests reports and updated versions of Perl related distributions will not accept very old versions of OpenSSL. If you're without luck to get an updated version or is not the administrator of the OS, check this article. Other alternative is change CPAN-Reporter to use HTTP instead of HTTPS by editing the configuration file config.ini (which is inside the cpanreporter directory, which location is highly dependent of your OS), changing the protocol transport of the URL metabase.cpantesters.org/api/v1/ from HTTPS to HTTP.
  2. Install a local perl to avoid root/administrator privileges: you can do it manually (by downloading from http://perl.org) or use Perlbrew or Plenv. You probably will want to use the last two options because you can get a local, customized perl installation without messing with the (probably) already perl setup available. You can get some performance improvement by compiling perl in your machine, specially if you setup it without some unnecessary features. Here is a good tip about doing a faster Perlbrew setup. Unfortunately, those tips seem to be available only for UNIX-like OS's. If you fall in this category, just install any Perl in your VM, but remember that your user will need to have proper rights to modify files where Perl was installed.
  3. Upgrade the CPAN module: after installing the Perl interpreter, upgrade CPAN using the commands "install CPAN" followed by "reload CPAN".
  4. Quit and restart the CPAN shell.
  5. Install the CPAN-SQLite distribution: this will make CPAN to runs faster by using a SQLite database. Installing it may required you to install additional libraries depending on your OS of choice. Be sure to check CPAN-SQLite environment variables and how to configure the CPAN shell to use it as well.
  6. Install YAML-LibYAML and configure the CPAN shell to use it by setting the option 'yaml_module YAML::XS'.
  7. Quit and restart the CPAN shell.
  8. Go back to the CPAN shell and install Task-CPAN-Reporter (required), Bundle-CPANReporter2, Test-Most, Module::Version Bundle::CPAN and Log::Log4perl (for additional flavor).
  9. Quit and restart the CPAN shell.
  10. Follow the instructions of the wiki TestDuringInstall.
  11. Test the CPAN-Reporter configuration by running the "upgrade" command (without options) in the CPAN shell. It should download the newest version of the already installed modules, unpack them, test and send the results one by one.
  12. Install the CPAN-Reporter-Smoker module.
  13. Install CPAN-Mini since it will provide a local repository for running tests, avoiding unnecessary network usage. Be sure also to read the related Pod to get the details, specially regarding the minicpan command line program. Also read about special CPAN::Mini configuration for use with CPAN::Reporter::Smoker Using a local CPAN::Mini mirror
  14. Fine tune the configuration of CPAN-Reporter-Smoker by checking the "HINTS" documentation of it.

Finally, you can have more information by checking the wiki page CPANReporterSmokerLong, but the information there is exclusive for UNIX-like OS's.

With a working, stable smoker in place, you can try and configure additional options to speed up it by reading CPANReporterSmokerFaster.

OS specific information

For specific information on the operational system of your choice to run a smoker, you can check out: