[Bps-public-commit] r14167 - Test-Chimps-Anna/trunk/lib/Test/Chimps

alexmv at bestpractical.com alexmv at bestpractical.com
Wed Jul 16 13:30:47 EDT 2008


Author: alexmv
Date: Wed Jul 16 13:30:46 2008
New Revision: 14167

Modified:
   Test-Chimps-Anna/trunk/lib/Test/Chimps/Anna.pm

Log:
 * Every 10 passing tests, note that we're still passing

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	Wed Jul 16 13:30:46 2008
@@ -13,7 +13,7 @@
 
 =head1 NAME
 
-Test::Chimps::Anna - An IRQ bot that announces test failures (and unexpected passes)
+Test::Chimps::Anna - An IRC bot that announces test failures (and unexpected passes)
 
 =head1 VERSION
 
@@ -36,7 +36,7 @@
       server   => "irc.perl.org",
       port     => "6667",
       channels => ["#example"],
-    
+
       nick      => "anna",
       username  => "nice_girl",
       name      => "Anna",
@@ -44,7 +44,7 @@
       config_file => '/path/to/chimps/anna-config.yml',
       server_script => 'http://example.com/cgi-bin/chimps-server.pl'
       );
-    
+
     $anna->run;
 
 =head1 METHODS
@@ -113,7 +113,7 @@
 
 sub _get_highest_oid {
   my $self = shift;
-  
+
   my $reports = Test::Chimps::ReportCollection->new(handle => $self->_handle);
   $reports->columns(qw/id/);
   $reports->unlimit;
@@ -175,14 +175,15 @@
         # don't announce if we've never seen this project before
         $self->{passing_projects}->{$report->project} = 1;
       }
-      next if $self->{passing_projects}->{$report->project};
-      $self->{passing_projects}->{$report->project} = 1;
-      
-      $self->{passing_projects}->{$report->project}++;
-      $self->_say_to_all("Smoke report for " .  $report->project
-                         . " r" . $report->revision . " submitted by ".$report->committer."; "
-                         . $report->duration . " seconds.  "
-                         . "All " . $report->total_ok . " tests pass");
+      if (    $self->{passing_projects}->{$report->project}++
+          and $self->{passing_projects}->{$report->project} % 10 == 0) {
+        $self->_say_to_all( $report->project . " still passing all " . $report->total_ok . " tests.  Woo!");
+      } else {
+        $self->_say_to_all("Smoke report for " .  $report->project
+                           . " r" . $report->revision . " submitted by ".$report->committer."; "
+                           . $report->duration . " seconds.  "
+                           . "All " . $report->total_ok . " tests pass");
+      }
     }
   }
 
@@ -191,10 +192,10 @@
     # we might already be at the highest oid
     $self->{oid} = $last->id;
   }
-  
+
   return 5;
 }
-  
+
 sub _say_to_all {
   my $self = shift;
   my $msg = shift;



More information about the Bps-public-commit mailing list