NAME

Test::Chimps::Smoker - Poll a set of SVN repositories and run tests when they change

SYNOPSIS

This module gives you everything you need to make your own build slave. You give it a configuration file describing all of your projects and how to test them, and it will monitor the SVN repositories, check the projects out (and their dependencies), test them, and submit the report to a server.

use Test::Chimps::Smoker;

my $poller = Test::Chimps::Smoker->new(
  server      => 'http://www.example.com/cgi-bin/chimps-server.pl',
  config_file => '/path/to/configfile.yml'


$poller->poll();

METHODS

new ARGS

Creates a new Client object. ARGS is a hash whose valid keys are:

  • config_file

    Mandatory. The configuration file describing which repositories to monitor. The format of the configuration is described in "CONFIGURATION FILE".

  • server

    Mandatory. The URI of the server script to upload the reports to.

  • simulate

    Don't actually submit the smoke reports, just run the tests. This does, however, increment the revision numbers in the config file.

smoke PARAMS

Calling smoke will cause the Smoker object to continually poll repositories for changes in revision numbers. If an (actual) change is detected, the repository will be checked out (with dependencies), built, and tested, and the resulting report will be submitted to the server. This method may not return. Valid options to smoke are:

  • iterations

    Specifies the number of iterations to run. This is the number of smoke reports to generate per project. A value of 'inf' means to continue smoking forever. Defaults to 'inf'.

  • projects

    An array reference specifying which projects to smoke. If the string 'all' is provided instead of an array reference, all projects will be smoked. Defaults to 'all'.

ACCESSORS

There are read-only accessors for server, config_file, and simulate.

CONFIGURATION FILE

The configuration file is YAML dump of a hash. The keys at the top level of the hash are project names. Their values are hashes that comprise the configuration options for that project.

Perhaps an example is best. A typical configuration file might look like this:

---
Some-jifty-project:
  configure_cmd: perl Makefile.PL --skipdeps && make
  dependencies:
    - Jifty
  revision: 555
  root_dir: trunk/foo
  svn_uri: svn+ssh://svn.example.com/svn/foo
Jifty:
  configure_cmd: perl Makefile.PL --skipdeps && make
  dependencies:
    - Jifty-DBI
  revision: 1332
  root_dir: trunk
  svn_uri: svn+ssh://svn.jifty.org/svn/jifty.org/jifty
Jifty-DBI:
  configure_cmd: perl Makefile.PL --skipdeps && make
  env:
    JDBI_TEST_MYSQL: jiftydbitestdb
    JDBI_TEST_MYSQL_PASS: ''
    JDBI_TEST_MYSQL_USER: jiftydbitest
    JDBI_TEST_PG: jiftydbitestdb
    JDBI_TEST_PG_USER: jiftydbitest
  revision: 1358
  root_dir: trunk
  svn_uri: svn+ssh://svn.jifty.org/svn/jifty.org/Jifty-DBI

The supported project options are as follows:

  • configure_cmd

    The command to configure the project after checkout, but before running tests.

  • revision

    This is the last revision known for a given project. When started, the poller will attempt to checkout and test all revisions (besides ones on which the directory did not change) between this one and HEAD. When a test has been successfully uploaded, the revision number is updated and the configuration file is re-written.

  • root_dir

    The subdirectory inside the repository where configuration and testing commands should be run.

  • svn_uri

    The subversion URI of the project.

  • env

    A hash of environment variable names and values that are set before configuration, and reverted to their previous values after the tests have been run. In addition, if environment variable FOO's new value contains the string "$FOO", then the old value of FOO will be substituted in when setting the environment variable.

  • dependencies

    A list of project names that are dependencies for the given project. All dependencies are checked out at HEAD, have their configuration commands run, and all dependencys' $root_dir/blib/lib directories are added to @INC before the configuration command for the project is run.

  • dependency_only

    Indicates that this project should not be tested. It is only present to serve as a dependency for another project.

REPORT VARIABLES

This module assumes the use of the following report variables:

project
revision
committer
duration
osname
osvers
archname

AUTHOR

Zev Benjamin, <zev at cpan.org>

BUGS

Please report any bugs or feature requests to bug-test-chimps at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Chimps-Client. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Test::Chimps::Smoker

You can also look for information at:

COPYRIGHT & LICENSE

Copyright 2006 Best Practical Solutions.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.