Bug 1054977 - Reduce max number of failures parsed/shown in annotated view
authorEd Morley <emorley@mozilla.com>
Wed, 25 Feb 2015 13:11:42 +0000
changeset 1511 ec1850f9e430773b6036a65e41d95382ae12ba3b
parent 1510 056344599c25e4bbd694939750c38c4cbe3c02d3
child 1512 9e445e011814957065225426bcff5e3c99cac072
push id873
push useremorley@mozilla.com
push dateWed, 25 Feb 2015 14:28:56 +0000
bugs1054977
Bug 1054977 - Reduce max number of failures parsed/shown in annotated view
php/inc/AnnotatedSummaryGenerator.php
php/inc/LogParser.php
--- a/php/inc/AnnotatedSummaryGenerator.php
+++ b/php/inc/AnnotatedSummaryGenerator.php
@@ -17,31 +17,31 @@ require_once 'inc/JSON.php';
 class AnnotatedSummaryGenerator implements LogGenerator {
   public function __construct($rawSummary, $logDescription) {
     $this->rawSummary = $rawSummary;
     $this->logDescription = $logDescription;
     $this->hasLeak = false;
   }
 
   public function generate($log) {
-    $maxAnnotatedFailures = 20;
+    $maxAnnotatedFailures = 5;
     $rawSummaryLines = GzipUtils::getLines($this->rawSummary);
     $annotatedLines = array();
     foreach ($rawSummaryLines as $i => $line) {
       // Only display the first N failures from the unannotated summary
       if ($i >= $maxAnnotatedFailures) {
         $totalParsedFailures = count($rawSummaryLines);
         // In extreme cases we will have truncated the raw log too (in Logparser.php),
         // so cannot state the actual number of failures. In which case, the truncation
         // message makes $totalParsedFailures exceed $maxParsedFailures.$maxParsedFailures
         // here should be kept in sync with LogParser.php's $maxParsedFailures.
         // TODO: Move these prefs to config.php so we don't have to keep them in sync
         // (once we have an in-repo config.php with passwords separated out, that isn't
         // a PITA to update).
-        $maxParsedFailures = 100;
+        $maxParsedFailures = 20;
         if ($totalParsedFailures > $maxParsedFailures)
           $totalParsedFailures = $maxParsedFailures . '+';
         $annotatedLines[] = "Only displaying first $maxAnnotatedFailures of $totalParsedFailures" .
                             " failures - <a href=\"php/getParsedLog.php?id=" . $_GET["id"] .
                             "\" target=\"_blank\">View log</a>.";
         break;
       }
       $this->processLine($annotatedLines, $line);
--- a/php/inc/LogParser.php
+++ b/php/inc/LogParser.php
@@ -32,17 +32,17 @@ class LogParser implements LogGenerator 
       $text = substr($text, 0, -1);
     if (substr($text, -1) == "\r")
       $text = substr($text, 0, -1);
     return '<a href="'.$target.'">'.htmlspecialchars($text)."</a>\n";
   }
 
   public function getExcerpt($asHTML = false) {
     // Keep in sync with AnnotatedSummaryGenerator.php's $maxParsedFailures
-    $maxParsedFailures = 100;
+    $maxParsedFailures = 20;
     $maxLineLength = 500;
     $type = $this->lineFilter->getType();
     // The TinderboxPrint and reftest analyser scrape lines must remain untouched.
     $canTruncate = ($type != "tinderbox_print" && $type != "reftest");
     $lines = $this->getLines();
     $matchedLineNumbers = $this->getMatchedLineNumbers();
     $excerptLines = array();
     foreach ($matchedLineNumbers as $i => $lineNumber) {