[Rt-commit] r5549 - in Test-Chimps/trunk: . lib/Test
lib/Test/Chimps lib/Test/Chimps/Server t t/chimps-home
t/chimps-home/chimpsdb
zev at bestpractical.com
zev at bestpractical.com
Tue Jul 11 18:19:43 EDT 2006
Author: zev
Date: Tue Jul 11 18:19:40 2006
New Revision: 5549
Added:
Test-Chimps/trunk/t/chimps-home/
Test-Chimps/trunk/t/chimps-home/chimpsdb/
Modified:
Test-Chimps/trunk/ (props changed)
Test-Chimps/trunk/MANIFEST
Test-Chimps/trunk/Makefile.PL
Test-Chimps/trunk/bin/submit_report.pl
Test-Chimps/trunk/lib/Test/Chimps.pm
Test-Chimps/trunk/lib/Test/Chimps/Client.pm
Test-Chimps/trunk/lib/Test/Chimps/Report.pm
Test-Chimps/trunk/lib/Test/Chimps/ReportCollection.pm
Test-Chimps/trunk/lib/Test/Chimps/Server.pm
Test-Chimps/trunk/lib/Test/Chimps/Server/Lister.pm
Test-Chimps/trunk/t/00-dependencies.t
Test-Chimps/trunk/t/01-report-basic.t
Test-Chimps/trunk/t/05-client-basic.t
Test-Chimps/trunk/t/10-server-basic.t
Log:
r11427 at galvatron: zev | 2006-07-11 18:19:29 -0400
* added POD
* made tests pass
* cleaned up submit_report.pl
* corrected dependencies
Modified: Test-Chimps/trunk/MANIFEST
==============================================================================
--- Test-Chimps/trunk/MANIFEST (original)
+++ Test-Chimps/trunk/MANIFEST Tue Jul 11 18:19:40 2006
@@ -1,6 +1,7 @@
bin/poll_and_submit.pl
bin/report_server.pl
bin/submit_report.pl
+bin/yaml2dbi.pl
Changes
examples/list.tmpl
inc/Module/AutoInstall.pm
@@ -17,26 +18,21 @@
lib/Test/Chimps.pm
lib/Test/Chimps/Client.pm
lib/Test/Chimps/Client/Poller.pm
-lib/Test/Chimps/Client/Poller.pm.orig
lib/Test/Chimps/Report.pm
+lib/Test/Chimps/ReportCollection.pm
lib/Test/Chimps/Server.pm
lib/Test/Chimps/Server/Lister.pm
Makefile.PL
-MANIFEST
-META.yml # Will be created by "make dist"
-patch
+MANIFEST This list of files
+META.yml
README
-t
t/00-dependencies.t
t/01-report-basic.t
t/05-client-basic.t
-t/10-server-base.t
t/10-server-basic.t
t/15-poller-basic.t
t/20-lister-basic.t
-t/bogus-tests
t/bogus-tests/00-basic.t
t/boilerplate.t
t/pod-coverage.t
t/pod.t
-TODO
Modified: Test-Chimps/trunk/Makefile.PL
==============================================================================
--- Test-Chimps/trunk/Makefile.PL (original)
+++ Test-Chimps/trunk/Makefile.PL Tue Jul 11 18:19:40 2006
@@ -10,13 +10,18 @@
requires('Date::Parse');
requires('DateTime');
requires('HTML::Mason');
+requires('Jifty::DBI::Collection');
+requires('Jifty::DBI::Handle');
+requires('Jifty::DBI::Record');
+requires('Jifty::DBI::Schema');
+requires('Jifty::DBI::SchemaGenerator');
requires('LWP::UserAgent');
-requires('Module::CoreList');
requires('Params::Validate');
-requires('Test::Dependencies');
requires('Test::TAP::HTMLMatrix');
requires('Test::TAP::Model::Visual');
requires('YAML::Syck');
+build_requires('Test::Dependencies');
+
auto_install;
WriteAll;
Modified: Test-Chimps/trunk/bin/submit_report.pl
==============================================================================
--- Test-Chimps/trunk/bin/submit_report.pl (original)
+++ Test-Chimps/trunk/bin/submit_report.pl Tue Jul 11 18:19:40 2006
@@ -4,27 +4,39 @@
use strict;
use Getopt::Long;
-use Test::Chimps::Report;
use Test::Chimps::Client;
use Test::TAP::Model::Visual;
-chdir "jifty/trunk";
+my $model;
+{
+ local $SIG{ALRM} = sub { die "10 minute timeout exceeded" };
+ alarm 600;
+ print "running tests for $project\n";
+ eval {
+ $model = Test::TAP::Model::Visual->new_with_tests(glob("t/*.t t/*/t/*.t"));
+ };
+ alarm 0; # cancel alarm
+}
+
+if ($@) {
+ print "Tests aborted: $@\n";
+}
-my $start_time = time;
-my $model = Test::TAP::Model::Visual->new_with_tests(glob("t/*.t t/*/t/*.t"));
-my $duration = time - $start_time;
-
-my $report = Test::Chimps::Report->new(model => $model,
- report_variables =>
- { category => 'Jifty',
- subcategory => 'repository snapshot / Linux',
- project => 'jifty',
- revision => 5,
- timestamp => scalar gmtime,
- duration => $duration });
+my $duration = $model->structure->{end_time} - $model->structure->{start_time};
-my $client = Test::Chimps::Client->new(reports => [$report],
- server => 'http://galvatron.mit.edu/cgi-bin/report_server.pl');
+my $client = Test::Chimps::Client->new(
+ model => $model,
+ server => 'http://galvatron.mit.edu/cgi-bin/report_server.pl',
+ {
+ project => $project,
+ revision => $revision,
+ committer => $committer,
+ duration => $duration,
+ osname => $Config{osname},
+ osvers => $Config{osvers},
+ archname => $Config{archname}
+ }
+);
my ($status, $msg) = $client->send;
Modified: Test-Chimps/trunk/lib/Test/Chimps.pm
==============================================================================
--- Test-Chimps/trunk/lib/Test/Chimps.pm (original)
+++ Test-Chimps/trunk/lib/Test/Chimps.pm Tue Jul 11 18:19:40 2006
@@ -4,11 +4,11 @@
=head1 VERSION
-Version 0.01
+Version 0.02
=cut
-our $VERSION = '0.01';
+our $VERSION = '0.02';
=head1 SYNOPSIS
Modified: Test-Chimps/trunk/lib/Test/Chimps/Client.pm
==============================================================================
--- Test-Chimps/trunk/lib/Test/Chimps/Client.pm (original)
+++ Test-Chimps/trunk/lib/Test/Chimps/Client.pm Tue Jul 11 18:19:40 2006
@@ -15,14 +15,6 @@
Test::Chimps::Client - Send smoke test results to a server
-=head1 VERSION
-
-Version 0.01
-
-=cut
-
-our $VERSION = '0.01';
-
=head1 SYNOPSIS
This module simplifies the process of sending smoke test results
Modified: Test-Chimps/trunk/lib/Test/Chimps/Report.pm
==============================================================================
--- Test-Chimps/trunk/lib/Test/Chimps/Report.pm (original)
+++ Test-Chimps/trunk/lib/Test/Chimps/Report.pm Tue Jul 11 18:19:40 2006
@@ -28,18 +28,33 @@
=item * model_structure
+=item * timestamp
+
=item * total_ok
+=item * total_passed
+
+=item * total_nok
+
=item * total_failed
-=item * total_todo
+=item * total_percentage
+
+=item * total_ratio
+
+=item * total_seen
=item * total_skipped
-=item * total_unexpectedly_succeeded
+=item * total_todo
+
+=item * total_unexpectedly_succeeded
=back
+Additionally, columns are added dynamically based on the report
+variables specified in the server.
+
=cut
use base qw/Jifty::DBI::Record/;
Modified: Test-Chimps/trunk/lib/Test/Chimps/ReportCollection.pm
==============================================================================
--- Test-Chimps/trunk/lib/Test/Chimps/ReportCollection.pm (original)
+++ Test-Chimps/trunk/lib/Test/Chimps/ReportCollection.pm Tue Jul 11 18:19:40 2006
@@ -3,10 +3,87 @@
use warnings;
use strict;
+=head1 NAME
+
+Test::Chimps::Report - Encapsulate a smoke test report
+
+=head1 SYNOPSIS
+
+FIXME
+
+=head1 METHODS
+
+=head2 new ARGS
+
+Creates a new Report. ARGS is a hash whose only valid key is
+handle. Its value must be a Jifty::DBI::Handle.
+
+=cut
+
use base qw/Jifty::DBI::Collection/;
+=head2 record_class
+
+Overridden method. Always returns 'Test::Chimps::Report'.
+
+=cut
+
sub record_class {
return 'Test::Chimps::Report';
}
+=head1 AUTHOR
+
+Zev Benjamin, C<< <zev at cpan.org> >>
+
+=head1 BUGS
+
+Please report any bugs or feature requests to
+C<bug-test-chimps at rt.cpan.org>, or through the web interface at
+L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Chimps>.
+I will be notified, and then you'll automatically be notified of progress on
+your bug as I make changes.
+
+=head1 SUPPORT
+
+You can find documentation for this module with the perldoc command.
+
+ perldoc Test::Chimps
+
+You can also look for information at:
+
+=over 4
+
+=item * AnnoCPAN: Annotated CPAN documentation
+
+L<http://annocpan.org/dist/Test-Chimps>
+
+=item * CPAN Ratings
+
+L<http://cpanratings.perl.org/d/Test-Chimps>
+
+=item * RT: CPAN's request tracker
+
+L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Chimps>
+
+=item * Search CPAN
+
+L<http://search.cpan.org/dist/Test-Chimps>
+
+=back
+
+=head1 ACKNOWLEDGEMENTS
+
+The code in this distribution is based on smokeserv-client.pl and
+smokeserv-server.pl from the Pugs distribution.
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2006 Zev Benjamin, all rights reserved.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+=cut
+
1;
Modified: Test-Chimps/trunk/lib/Test/Chimps/Server.pm
==============================================================================
--- Test-Chimps/trunk/lib/Test/Chimps/Server.pm (original)
+++ Test-Chimps/trunk/lib/Test/Chimps/Server.pm Tue Jul 11 18:19:40 2006
@@ -29,14 +29,6 @@
Test::Chimps::Server - Accept smoke report uploads and display smoke reports
-=head1 VERSION
-
-Version 0.01
-
-=cut
-
-our $VERSION = '0.01';
-
=head1 SYNOPSIS
This module simplifies the process of running a smoke server. It
Modified: Test-Chimps/trunk/lib/Test/Chimps/Server/Lister.pm
==============================================================================
--- Test-Chimps/trunk/lib/Test/Chimps/Server/Lister.pm (original)
+++ Test-Chimps/trunk/lib/Test/Chimps/Server/Lister.pm Tue Jul 11 18:19:40 2006
@@ -57,6 +57,12 @@
);
+=head2 new
+
+Returns a new Lister object
+
+=cut
+
sub new {
my $class = shift;
my $obj = bless {}, $class;
@@ -86,6 +92,12 @@
}
}
+=head2 output_list
+
+Output the smoke report listing.
+
+=cut
+
sub output_list {
my ($self, $template_dir, $reports, $cgi) = @_;
Modified: Test-Chimps/trunk/t/00-dependencies.t
==============================================================================
--- Test-Chimps/trunk/t/00-dependencies.t (original)
+++ Test-Chimps/trunk/t/00-dependencies.t Tue Jul 11 18:19:40 2006
@@ -1,4 +1,4 @@
-#!perl -T
+#!perl
use Test::Dependencies exclude => [qw/Test::Chimps/];
Modified: Test-Chimps/trunk/t/01-report-basic.t
==============================================================================
--- Test-Chimps/trunk/t/01-report-basic.t (original)
+++ Test-Chimps/trunk/t/01-report-basic.t Tue Jul 11 18:19:40 2006
@@ -1,6 +1,6 @@
#!perl -T
-use Test::More tests => 5;
+use Test::More tests => 3;
BEGIN {
use_ok( 'Test::Chimps::Report' );
@@ -8,12 +8,6 @@
use Test::TAP::Model::Visual;
-my $m = Test::TAP::Model::Visual->new_with_tests('t/bogus-tests/00-basic.t');
-
-# Test::Harness::Straps breaks under taint mode, so Test::TAP::Model also breaks
-my $r = Test::Chimps::Report->new(model => $m, report_text => "foo");
+my $r = Test::Chimps::Report->new();
ok($r, "the report object is defined");
isa_ok($r, 'Test::Chimps::Report', "and it's of the correct type");
-
-is($r->model_structure, $m->structure, "the model_structure accessor works");
-is($r->report_text, "foo", "the report_text accessor works");
Modified: Test-Chimps/trunk/t/05-client-basic.t
==============================================================================
--- Test-Chimps/trunk/t/05-client-basic.t (original)
+++ Test-Chimps/trunk/t/05-client-basic.t Tue Jul 11 18:19:40 2006
@@ -2,7 +2,6 @@
use Test::More tests => 6;
-use Test::Chimps::Report;
use Test::TAP::Model::Visual;
BEGIN {
@@ -11,17 +10,13 @@
my $m = Test::TAP::Model::Visual->new_with_tests('t/bogus-tests/00-basic.t');
-# Test::Harness::Straps breaks under taint mode, so Test::TAP::Model also breaks
-my $r = Test::Chimps::Report->new(model => $m, report_text => "foo");
-
-my $reports = [$r];
-my $c = Test::Chimps::Client->new(reports => $reports,
+my $c = Test::Chimps::Client->new(model => $m,
server => 'bogus',
compress => 1);
ok($c, "the client object is defined");
isa_ok($c, 'Test::Chimps::Client', "and it's of the correct type");
-is($c->reports, $reports, "the reports accessor works");
+is($c->model, $m, "the reports accessor works");
is($c->server, "bogus", "the server accessor works");
is($c->compress, 1, "the compress accessor works");
Modified: Test-Chimps/trunk/t/10-server-basic.t
==============================================================================
--- Test-Chimps/trunk/t/10-server-basic.t (original)
+++ Test-Chimps/trunk/t/10-server-basic.t Tue Jul 11 18:19:40 2006
@@ -2,11 +2,17 @@
use Test::More tests => 3;
+if (-e 't/chimps-home/chimpsdb/database') {
+ unlink qw(t/chimps-home/database);
+}
+
BEGIN {
use_ok('Test::Chimps::Server');
}
-my $s = Test::Chimps::Server->new(base_dir => '/var/www');
+my $s = Test::Chimps::Server->new(base_dir => 't/chimps-home');
ok($s, "the server object is defined");
isa_ok($s, 'Test::Chimps::Server', "and it's of the correct type");
+
+unlink qw(t/chimps-home/chimpsdb/database);
More information about the Rt-commit
mailing list