[Rt-commit] r5763 - in Test-Chimps-Client/trunk: . bin
zev at bestpractical.com
zev at bestpractical.com
Sun Aug 13 14:45:44 EDT 2006
Author: zev
Date: Sun Aug 13 14:45:43 2006
New Revision: 5763
Modified:
Test-Chimps-Client/trunk/ (props changed)
Test-Chimps-Client/trunk/Changes
Test-Chimps-Client/trunk/MANIFEST
Test-Chimps-Client/trunk/bin/chimps-smoker.pl
Test-Chimps-Client/trunk/lib/Test/Chimps/Client.pm
Test-Chimps-Client/trunk/lib/Test/Chimps/Smoker.pm
Log:
r12728 at truegrounds: zev | 2006-08-13 14:45:27 -0400
* documentation
Modified: Test-Chimps-Client/trunk/Changes
==============================================================================
--- Test-Chimps-Client/trunk/Changes (original)
+++ Test-Chimps-Client/trunk/Changes Sun Aug 13 14:45:43 2006
@@ -1,5 +1,9 @@
Revision history for Test-Chimps-Client
+0.05 Sun Aug 13 14:43:14 EDT 2006
+ * added information about the mailing list
+ * documented chimps-smoker.pl
+
0.04 Fri Jul 28 14:29:34 EDT 2006
* Test::Chimps::Smoker->smoke can now take number of
iterations and which projects to smoke as arguments
Modified: Test-Chimps-Client/trunk/MANIFEST
==============================================================================
--- Test-Chimps-Client/trunk/MANIFEST (original)
+++ Test-Chimps-Client/trunk/MANIFEST Sun Aug 13 14:45:43 2006
@@ -1,6 +1,6 @@
+bin/chimps-smoker.pl
Changes
examples/chimps-client.pl
-examples/chimps-smoker.pl
inc/Module/AutoInstall.pm
inc/Module/Install.pm
inc/Module/Install/AutoInstall.pm
@@ -26,3 +26,4 @@
t/boilerplate.t
t/pod-coverage.t
t/pod.t
+Test-Chimps-Client-0.03.tar.gz
Modified: Test-Chimps-Client/trunk/bin/chimps-smoker.pl
==============================================================================
--- Test-Chimps-Client/trunk/bin/chimps-smoker.pl (original)
+++ Test-Chimps-Client/trunk/bin/chimps-smoker.pl Sun Aug 13 14:45:43 2006
@@ -6,24 +6,37 @@
use Test::Chimps::Smoker;
use File::Spec;
use Getopt::Long;
+use Pod::Usage;
my $server;
my $config_file = File::Spec->catfile($ENV{HOME}, 'smoker-config.yml');
my $iterations = 'inf';
my $projects = 'all';
+my $help = 0;
-my $result = GetOptions("server|s=s", \$server,
- "config_file|c=s", \$config_file,
- "iterations|i=i", \$iterations,
- "projects|p=s", \$projects);
-if (! $result) {
- print "Error during argument processing\n";
- exit 1;
+GetOptions("server|s=s", \$server,
+ "config_file|c=s", \$config_file,
+ "iterations|i=i", \$iterations,
+ "projects|p=s", \$projects,
+ "help|h", \$help)
+ || pod2usage(-exitval => 2,
+ -verbose => 1);
+
+
+if ($help) {
+ pod2usage(-exitval => 1,
+ -verbose => 2,
+ -noperldoc => 1);
}
if (! defined $server) {
print "You must specify a server to upload results to\n";
- exit 1;
+ exit 2;
+}
+
+if (! defined $server) {
+ print "You must specify a configuration file\n";
+ exit 2;
}
if ($projects ne 'all') {
@@ -37,3 +50,54 @@
$poller->smoke(iterations => $iterations,
projects => $projects);
+
+__DATA__
+
+=head1 NAME
+
+chimps-smoker.pl - continually smoke projects
+
+=head1 SYNOPSIS
+
+chimps-smoker.pl --server SERVER --config_file CONFIG_FILE
+ [--iterations N] [--projects PROJECT1,PROJECT2,... ]
+
+This program is a wrapper around Test::Chimps::Smoker, which allows
+you to specify common options on the command line.
+
+=head1 ARGUMENTS
+
+=head2 --config_file, -c
+
+Specifies the path to the configuration file. For more information
+about the configuration file format, see L<Test::Chimps::Smoker>.
+
+=head2 --server, -s
+
+Specifies the full path to the chimps server CGI.
+
+=head1 OPTIONS
+
+=head2 --iterations, -i
+
+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'.
+
+=head2 --projects, -p
+
+A comma-separated list of projects to smoke. If the string 'all'
+is provided, all projects will be smoked. Defaults to 'all'.
+
+=head1 AUTHOR
+
+Zev Benjamin C<< zev at cpan.org >>
+
+=head1 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.
+
+=cut
Modified: Test-Chimps-Client/trunk/lib/Test/Chimps/Client.pm
==============================================================================
--- Test-Chimps-Client/trunk/lib/Test/Chimps/Client.pm (original)
+++ Test-Chimps-Client/trunk/lib/Test/Chimps/Client.pm Sun Aug 13 14:45:43 2006
@@ -16,11 +16,11 @@
=head1 VERSION
-Version 0.04
+Version 0.05
=cut
-our $VERSION = '0.04';
+our $VERSION = '0.05';
=head1 SYNOPSIS
@@ -64,6 +64,11 @@
Mandatory. The value must be a C<Test::TAP::Model>. These are the
test results that will be submitted to the server.
+=item * report_variables
+
+Optional. A hashref of report variables and values to send to the
+server.
+
=item * server
Mandatory. The URI of the server script to upload the model to.
@@ -164,6 +169,13 @@
=over 4
+=item * Mailing list
+
+Chimps has a mailman mailing list at
+L<chimps at bestpractical.com>. You can subscribe via the web
+interface at
+L<http://lists.bestpractical.com/cgi-bin/mailman/listinfo/chimps>.
+
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/Test-Chimps-Client>
Modified: Test-Chimps-Client/trunk/lib/Test/Chimps/Smoker.pm
==============================================================================
--- Test-Chimps-Client/trunk/lib/Test/Chimps/Smoker.pm (original)
+++ Test-Chimps-Client/trunk/lib/Test/Chimps/Smoker.pm Sun Aug 13 14:45:43 2006
@@ -102,7 +102,7 @@
$self->_added_to_inc([]);
$self->_env_stack([]);
$self->_checkout_paths([]);
-
+
$self->_config(LoadFile($self->config_file));
}
@@ -117,9 +117,9 @@
my $self = shift;
my $project = shift;
my $config = $self->_config;
-
+
return 1 if $config->{$project}->{dependency_only};
-
+
my $info_out = `svn info $config->{$project}->{svn_uri}`;
$info_out =~ m/^Revision: (\d+)/m;
my $latest_revision = $1;
@@ -142,7 +142,7 @@
$info_out = `svn info -r $revision $config->{$project}->{svn_uri}`;
$info_out =~ m/^Last Changed Author: (\w+)/m;
my $committer = $1;
-
+
$config->{$project}->{revision} = $revision;
$self->_checkout_project($config->{$project}, $revision);
@@ -157,15 +157,15 @@
};
alarm 0; # cancel alarm
}
-
+
if ($@) {
print "Tests aborted: $@\n";
}
-
+
my $duration = $model->structure->{end_time} - $model->structure->{start_time};
$self->_unroll_env_stack;
-
+
foreach my $libdir (@{$self->_added_to_inc}) {
print "removing $libdir from \@INC\n";
shift @INC;
@@ -179,17 +179,19 @@
}
$self->_checkout_paths([]);
- my $client = Test::Chimps::Client->new(model => $model,
- report_variables =>
- { project => $project,
- revision => $revision,
- committer => $committer,
- duration => $duration,
- osname => $Config{osname},
- osvers => $Config{osvers},
- archname => $Config{archname}
- },
- server => $self->server);
+ my $client = Test::Chimps::Client->new(
+ model => $model,
+ report_variables => {
+ project => $project,
+ revision => $revision,
+ committer => $committer,
+ duration => $duration,
+ osname => $Config{osname},
+ osvers => $Config{osvers},
+ archname => $Config{archname}
+ },
+ server => $self->server
+ );
my ($status, $msg);
if ($self->simulate) {
@@ -197,7 +199,7 @@
} else {
($status, $msg) = $client->send;
}
-
+
if ($status) {
print "Sumbitted smoke report for $project revision $revision\n";
DumpFile($self->config_file, $config);
@@ -290,7 +292,7 @@
my $projects = $args{projects};
my $iterations = $args{iterations};
$self->_validate_projects_opt($projects);
-
+
if ($projects eq 'all') {
$projects = [keys %$config];
}
@@ -307,7 +309,7 @@
die "no such project: '$project'"
unless exists $self->_config->{$project};
}
-}
+}
sub _checkout_project {
my $self = shift;
@@ -329,7 +331,7 @@
$self->_checkout_project($self->_config->{$dep}, 'HEAD');
}
}
-
+
chdir($projectdir);
my $old_perl5lib = $ENV{PERL5LIB};
@@ -339,7 +341,7 @@
system($project->{configure_cmd});
}
$ENV{PERL5LIB} = $old_perl5lib;
-
+
for my $libloc (qw{blib/lib}) {
my $libdir = File::Spec->catdir($tmpdir,
$project->{root_dir},
@@ -423,24 +425,24 @@
Perhaps an example is best. A typical configuration file might
look like this:
- ---
- Some-jifty-project:
+ ---
+ Some-jifty-project:
configure_cmd: perl Makefile.PL --skipdeps && make
- dependencies:
+ dependencies:
- Jifty
revision: 555
root_dir: trunk/foo
svn_uri: svn+ssh://svn.example.com/svn/foo
- Jifty:
+ Jifty:
configure_cmd: perl Makefile.PL --skipdeps && make
- dependencies:
+ dependencies:
- Jifty-DBI
revision: 1332
root_dir: trunk
svn_uri: svn+ssh://svn.jifty.org/svn/jifty.org/jifty
- Jifty-DBI:
+ Jifty-DBI:
configure_cmd: perl Makefile.PL --skipdeps && make
- env:
+ env:
JDBI_TEST_MYSQL: jiftydbitestdb
JDBI_TEST_MYSQL_PASS: ''
JDBI_TEST_MYSQL_USER: jiftydbitest
@@ -449,7 +451,7 @@
revision: 1358
root_dir: trunk
svn_uri: svn+ssh://svn.jifty.org/svn/jifty.org/Jifty-DBI
-
+
The supported project options are as follows:
=over 4
@@ -499,6 +501,18 @@
=back
+=head1 REPORT VARIABLES
+
+This module assumes the use of the following report variables:
+
+ project
+ revision
+ committer
+ duration
+ osname
+ osvers
+ archname
+
=head1 AUTHOR
Zev Benjamin, C<< <zev at cpan.org> >>
@@ -521,6 +535,13 @@
=over 4
+=item * Mailing list
+
+Chimps has a mailman mailing list at
+L<chimps at bestpractical.com>. You can subscribe via the web
+interface at
+L<http://lists.bestpractical.com/cgi-bin/mailman/listinfo/chimps>.
+
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/Test-Chimps-Client>
More information about the Rt-commit
mailing list