[Rt-commit] r5540 - in Test-Chimps/branches/dbi: . bin lib/Test/Chimps lib/Test/Chimps/Client

zev at bestpractical.com zev at bestpractical.com
Thu Jul 6 16:27:24 EDT 2006


Author: zev
Date: Thu Jul  6 16:27:22 2006
New Revision: 5540

Modified:
   Test-Chimps/branches/dbi/   (props changed)
   Test-Chimps/branches/dbi/bin/report_server.pl
   Test-Chimps/branches/dbi/bin/yaml2dbi.pl
   Test-Chimps/branches/dbi/lib/Test/Chimps/Client/Poller.pm
   Test-Chimps/branches/dbi/lib/Test/Chimps/Report.pm
   Test-Chimps/branches/dbi/lib/Test/Chimps/Server.pm
   Test-Chimps/branches/dbi/lib/Test/Chimps/Server/Lister.pm

Log:
 r11369 at galvatron:  zev | 2006-07-06 16:23:40 -0400
 * moved timestamping to the server
 * get duration from the Test::TAP::Model


Modified: Test-Chimps/branches/dbi/bin/report_server.pl
==============================================================================
--- Test-Chimps/branches/dbi/bin/report_server.pl	(original)
+++ Test-Chimps/branches/dbi/bin/report_server.pl	Thu Jul  6 16:27:22 2006
@@ -8,7 +8,6 @@
                                        { project => 1,
                                          revision => 1,
                                          committer => 1,
-                                         timestamp => 1,
                                          duration => 1,
                                          osname => 1,
                                          osvers => 1,

Modified: Test-Chimps/branches/dbi/bin/yaml2dbi.pl
==============================================================================
--- Test-Chimps/branches/dbi/bin/yaml2dbi.pl	(original)
+++ Test-Chimps/branches/dbi/bin/yaml2dbi.pl	Thu Jul  6 16:27:22 2006
@@ -12,6 +12,8 @@
 use File::Spec;
 use Test::TAP::Model::Visual;
 use Test::Chimps::Report;
+use DateTime;
+use Date::Parse;
 
 package Test::Chimps::Report::Schema;
 
@@ -98,6 +100,11 @@
   }
 
   $params->{project} =~ s/^\l(.)/\u$1/;
+
+  $params->{timestamp} =
+    DateTime->from_epoch(epoch => str2time($params->{timestamp}));
+
+
    
   $rec->create(%$params);
 }

Modified: Test-Chimps/branches/dbi/lib/Test/Chimps/Client/Poller.pm
==============================================================================
--- Test-Chimps/branches/dbi/lib/Test/Chimps/Client/Poller.pm	(original)
+++ Test-Chimps/branches/dbi/lib/Test/Chimps/Client/Poller.pm	Thu Jul  6 16:27:22 2006
@@ -152,9 +152,9 @@
         $self->_checkout_project($config->{$project}, $revision);
 
         print "running tests for $project\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 $duration = $model->structure->{end_time} - $model->structure->{start_time};
 
         $self->_unroll_env_stack;
         
@@ -176,7 +176,6 @@
                                                { project => $project,
                                                  revision => $revision,
                                                  committer => $committer,
-                                                 timestamp => scalar gmtime,
                                                  duration => $duration,
                                                  osname => $Config{osname},
                                                  osvers => $Config{osvers},

Modified: Test-Chimps/branches/dbi/lib/Test/Chimps/Report.pm
==============================================================================
--- Test-Chimps/branches/dbi/lib/Test/Chimps/Report.pm	(original)
+++ Test-Chimps/branches/dbi/lib/Test/Chimps/Report.pm	Thu Jul  6 16:27:22 2006
@@ -51,6 +51,8 @@
 column report_html                  => type is 'text';
 column model_structure              => type is 'text',
   filters are 'Jifty::DBI::Filter::Storable', 'Jifty::DBI::Filter::base64';
+column timestamp                    => type is 'date',
+  filters are 'Jifty::DBI::Filter::DateTime';
 column total_ok                     => type is 'integer';
 column total_passed                 => type is 'integer';
 column total_nok                    => type is 'integer';

Modified: Test-Chimps/branches/dbi/lib/Test/Chimps/Server.pm
==============================================================================
--- Test-Chimps/branches/dbi/lib/Test/Chimps/Server.pm	(original)
+++ Test-Chimps/branches/dbi/lib/Test/Chimps/Server.pm	Thu Jul  6 16:27:22 2006
@@ -21,6 +21,7 @@
 use Test::TAP::HTMLMatrix;
 use Test::TAP::Model::Visual;
 use YAML::Syck;
+use DateTime;
 
 use constant PROTO_VERSION => 0.2;
 
@@ -344,6 +345,9 @@
   my $cgi = shift;
 
   my $params = {};
+
+  $params->{timestamp} = DateTime->from_epoch(epoch => time);
+  
   my $report_variables = thaw($cgi->param('report_variables'));
   foreach my $var (keys %{$report_variables}) {
     $params->{$var} = $report_variables->{$var};

Modified: Test-Chimps/branches/dbi/lib/Test/Chimps/Server/Lister.pm
==============================================================================
--- Test-Chimps/branches/dbi/lib/Test/Chimps/Server/Lister.pm	(original)
+++ Test-Chimps/branches/dbi/lib/Test/Chimps/Server/Lister.pm	Thu Jul  6 16:27:22 2006
@@ -7,7 +7,6 @@
 use Test::Chimps::Report;
 use HTML::Mason;
 use DateTime;
-use Date::Parse;
 
 =head1 NAME
 
@@ -146,9 +145,7 @@
     return $res;
   }
   
-  my ($adate, $bdate) = (DateTime->from_epoch(epoch => str2time($a->timestamp)),
-                         DateTime->from_epoch(epoch => str2time($b->timestamp)));
-  return DateTime->compare($bdate, $adate);
+  return DateTime->compare($b->timestamp, $a->timestamp);
 }
 
 sub _prune_reports {


More information about the Rt-commit mailing list