Test::Chimps::Smoker - Poll a set of SVN repositories and run tests when they change
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();
Creates a new Client object. ARGS is a hash whose valid keys are:
Mandatory. The configuration file describing which repositories to monitor. The format of the configuration is described in "CONFIGURATION FILE".
Mandatory. The URI of the server script to upload the reports to.
Don't actually submit the smoke reports, just run the tests. This does, however, increment the revision numbers in the config file.
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:
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'.
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'.
There are read-only accessors for server, config_file, and simulate.
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:
The command to configure the project after checkout, but before running tests.
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.
The subdirectory inside the repository where configuration and testing commands should be run.
The subversion URI of the project.
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.
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.
Indicates that this project should not be tested. It is only present to serve as a dependency for another project.
This module assumes the use of the following report variables:
project revision committer duration osname osvers archname
<zev at cpan.org>
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.
You can find documentation for this module with the perldoc command.
You can also look for information at:
Chimps has a mailman mailing list at email@example.com. You can subscribe via the web interface at http://lists.bestpractical.com/cgi-bin/mailman/listinfo/chimps.
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.