Bug 1054977 - Reduce max number of failures parsed/shown in annotated view
--- 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) {