[Bps-public-commit] r13547 - in Test-Chimps-Anna/trunk: .

alexmv at bestpractical.com alexmv at bestpractical.com
Mon Jun 23 17:37:42 EDT 2008


Author: alexmv
Date: Mon Jun 23 17:37:42 2008
New Revision: 13547

Modified:
   Test-Chimps-Anna/trunk/   (props changed)
   Test-Chimps-Anna/trunk/lib/Test/Chimps/Anna.pm

Log:
 r33417 at kohr-ah:  chmrr | 2008-06-23 17:37:35 -0400
  * Add durations to anna's messages
  * Pg database support


Modified: Test-Chimps-Anna/trunk/lib/Test/Chimps/Anna.pm
==============================================================================
--- Test-Chimps-Anna/trunk/lib/Test/Chimps/Anna.pm	(original)
+++ Test-Chimps-Anna/trunk/lib/Test/Chimps/Anna.pm	Mon Jun 23 17:37:42 2008
@@ -87,9 +87,6 @@
   my $self = $class->SUPER::new(@_);
   $self = bless $self, $class;
   my %args = @_;
-  if (! exists $args{database_file}) {
-    croak "You must specify SQLite database file!";
-  }
   if (exists $args{config_file}) {
     my $columns = LoadFile($args{config_file});
     foreach my $var (@$columns) {
@@ -101,13 +98,14 @@
     }
   }
   $self->{notices} = $args{notices};
-  $self->{database_file} = $args{database_file};
-  
+
   $self->{handle} = Jifty::DBI::Handle->new();
-  $self->{handle}->connect(driver => 'SQLite', database => $self->{database_file})
-    or die "Couldn't connect to database";
+  $self->{handle}->connect(driver => $args{database_driver} || "Pg",
+                           database => $args{database} || "smoke",
+                           user => $args{database_user} || "postgres",
+                           password => $args{database_password} || "");
 
-  $self->{oid} = $self->_get_highest_oid;
+  $self->{oid} = $ENV{LATEST} || $self->_get_highest_oid;
   $self->{first_run} = 1;
   $self->{passing_projects} = {};
   return $self;
@@ -119,7 +117,7 @@
   my $reports = Test::Chimps::ReportCollection->new(handle => $self->_handle);
   $reports->columns(qw/id/);
   $reports->unlimit;
-  $reports->order_by(column => 'id', order => 'DES');
+  $reports->order_by(column => 'id', order => 'DESC');
   $reports->rows_per_page(1);
 
   my $report = $reports->next;
@@ -167,7 +165,8 @@
         . $report->total_failed . " failed, "
         . $report->total_todo . " todo, "
         . $report->total_skipped . " skipped, "
-        . $report->total_unexpectedly_succeeded . " unexpectedly succeeded.  "
+        . $report->total_unexpectedly_succeeded . " unexpectedly succeeded; "
+        . $report->duration . " seconds.  "
         . $self->{server_script} . "?id=" . $report->id;
 
       $self->_say_to_all($msg);
@@ -181,8 +180,9 @@
       
       $self->{passing_projects}->{$report->project}++;
       $self->_say_to_all("Smoke report for " .  $report->project
-                         . " r" . $report->revision . " submitted: "
-                         . "all " . $report->total_ok . " tests pass");
+                         . " r" . $report->revision . " submitted; "
+                         . $report->duration . " seconds.  "
+                         . "All " . $report->total_ok . " tests pass");
     }
   }
 



More information about the Bps-public-commit mailing list