[Rt-commit] r5426 - in Test-Chimps: trunk/bin trunk/examples
zev at bestpractical.com
zev at bestpractical.com
Fri Jun 23 17:33:03 EDT 2006
Author: zev
Date: Fri Jun 23 17:32:55 2006
New Revision: 5426
Added:
Test-Chimps/trunk/bin/poll_and_submit.pl (contents, props changed)
Modified:
Test-Chimps/ (props changed)
Test-Chimps/trunk/bin/report_server.pl
Test-Chimps/trunk/examples/list.tmpl
Log:
r4190 at galvatron (orig r7): zev | 2006-06-20 17:58:32 -0400
r4130 at galvatron: zev | 2006-06-19 04:45:54 -0400
wrote poll script
Added: Test-Chimps/trunk/bin/poll_and_submit.pl
==============================================================================
--- (empty file)
+++ Test-Chimps/trunk/bin/poll_and_submit.pl Fri Jun 23 17:32:55 2006
@@ -0,0 +1,70 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+use Test::Smoke::Report;
+use Test::Smoke::Report::Client;
+use Test::TAP::Model::Visual;
+use YAML::Syck;
+use File::Basename;
+use File::Temp qw/tempdir/;
+use File::Path;
+
+my $config = LoadFile("/home/zev/bps/poll-config.yml");
+
+while (1) {
+ foreach my $category (keys %{$config}) {
+ my $info_out = `svn info $config->{$category}->{svn_uri}`;
+ $info_out =~ m/Revision: (\d+)/;
+ my $revision = $1;
+ $info_out =~ m/Last Changed Author: (\w+)/;
+ my $author = $1;
+
+ next unless $revision > $config->{$category}->{revision};
+
+ $config->{$category}->{revision} = $revision;
+
+ my $tmpdir = tempdir("smoke-svn-XXXXXXX", TMPDIR => 1);
+
+ system("svn co $config->{$category}->{svn_uri} $tmpdir > /dev/null");
+
+ chdir(File::Spec->catdir($tmpdir, $config->{$category}->{root_dir}));
+ my $libdir = File::Spec->catdir($tmpdir,
+ $config->{$category}->{root_dir},
+ 'lib');
+
+ unshift @INC, $libdir;
+
+ my $start_time = time;
+ my $model = Test::TAP::Model::Visual->new_with_tests(glob("t/*.t t/*/t/*.t"));
+ my $duration = time - $start_time;
+
+ shift @INC;
+
+ chdir(File::Spec->rootdir);
+ rmtree($tmpdir, 0, 0);
+
+ my $report = Test::Smoke::Report->new(model => $model,
+ extra_data =>
+ { category => $category,
+ subcategory => 'repository snapshot / Linux',
+ project => scalar fileparse($config->{$category}->{svn_uri}),
+ revision => $revision,
+ author => $author,
+ timestamp => scalar gmtime,
+ duration => $duration });
+
+ my $client = Test::Smoke::Report::Client->new(reports => [$report],
+ server => 'http://galvatron.mit.edu/cgi-bin/report_server.pl');
+
+ my ($status, $msg) = $client->send;
+
+ if (! $status) {
+ print "Error: $msg\n";
+ }
+ DumpFile("/home/zev/bps/poll-config.yml", $config);
+ }
+ sleep 300;
+}
+
Modified: Test-Chimps/trunk/bin/report_server.pl
==============================================================================
--- Test-Chimps/trunk/bin/report_server.pl (original)
+++ Test-Chimps/trunk/bin/report_server.pl Fri Jun 23 17:32:55 2006
@@ -10,6 +10,7 @@
subcategory => 1,
project => 1,
revision => 1,
+ author => 1,
timestamp => 1,
duration => 1 });
Modified: Test-Chimps/trunk/examples/list.tmpl
==============================================================================
--- Test-Chimps/trunk/examples/list.tmpl (original)
+++ Test-Chimps/trunk/examples/list.tmpl Fri Jun 23 17:32:55 2006
@@ -85,9 +85,10 @@
<td>
r<% $data->{revision} %>
</td>
+ <td class="leftsep"><% $data->{author} %></td>
<td class="leftsep"><% $data->{timestamp} %></td>
<td class="leftsep num"><% $data->{duration} %> sec</td>
- <td class="leftsep num"><% $model->total_ratio * 100 %>% ok</td>
+ <td class="leftsep num"><% sprintf("%.2f", $model->total_ratio * 100) %>% ok</td>
<td class="leftsep num tests_total"><span title="<% $model->total_seen %> total"><% $model->total_seen %></span>:</td>
<td class="num tests_ok"><span title="<% $model->total_ok %> ok"><% $model->total_ok %></span>,</td>
<td class="num tests_failed"><span title="<% $model->total_failed %> failed"><% $model->total_failed %></span>,</td>
More information about the Rt-commit
mailing list