Teach TestFailures to abbreviate the examples of test flakiness
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Jul 2011 19:05:44 +0000 (19:05 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Jul 2011 19:05:44 +0000 (19:05 +0000)
These lists can get quite long, and it's not really helpful in most cases to have soooooo
many examples of flakiness.

Fixes <http://webkit.org/b/64203> Lists of flaky revisions on TestFailures page can get so
long they're hard to navigate

Reviewed by Dan Bates.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/FlakyLayoutTestDetector.js:
(FlakyLayoutTestDetector.prototype.flakinessExamples): If we have more than a certain number
of examples, replace the middle items with a separator.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/TestFailures.css:
(.flakiness-example-separator): Added styles for the separator.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js:
(ViewController.prototype._domForPossiblyFlakyTests): Use a vertical ellipsis to represent
the separator.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90682 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/FlakyLayoutTestDetector.js
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/TestFailures.css
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js
Tools/ChangeLog

index c24841f..6e15048 100644 (file)
@@ -88,6 +88,24 @@ FlakyLayoutTestDetector.prototype = {
             examples.push(history[i + 1]);
         }
 
+        // The list of examples can get quite long. Instead of showing the whole list, we abbreviate
+        // by replacing the middle items with a separator.
+        const startAndEndAbbreviatedExamplesCount = 3;
+        console.assert(startAndEndAbbreviatedExamplesCount > 1);
+        var abbreviatedExamplesToShow = 2 * startAndEndAbbreviatedExamplesCount;
+        if (examples.length > abbreviatedExamplesToShow) {
+            var examplesBeforeSeparator = examples.slice(0, startAndEndAbbreviatedExamplesCount);
+            var examplesAfterSeparator = examples.slice(-startAndEndAbbreviatedExamplesCount);
+
+            // There's no real use in having two "pass" examples in a row immediately next to the
+            // separator.
+            if (examplesBeforeSeparator[examplesBeforeSeparator.length - 1].result.failureType === 'pass' && examplesBeforeSeparator[examplesBeforeSeparator.length - 2].result.failureType === 'pass')
+                examplesBeforeSeparator.splice(examplesBeforeSeparator.length - 1, 1);
+            if (examplesAfterSeparator[0].result.failureType === 'pass' && examplesAfterSeparator[1].result.failureType === 'pass')
+                examplesAfterSeparator.splice(0, 1);
+            examples = examplesBeforeSeparator.concat({ isSeparator: true }, examplesAfterSeparator);
+        }
+
         return examples;
     },
 
index d9cf3b2..47fcbbe 100644 (file)
@@ -511,6 +511,12 @@ ViewController.prototype = {
             item.appendChild(historyList);
             historyList.appendChildren(possiblyFlakyTestData[testName].map(function(historyItem) {
                 var item = document.createElement('li');
+                if (historyItem.isSeparator) {
+                    const verticalEllipsis = '\u22ee';
+                    item.appendChild(document.createTextNode(verticalEllipsis));
+                    item.className = 'flakiness-example-separator';
+                    return item;
+                }
                 item.appendChild(self._domForBuildName(builder, historyItem.build));
                 item.appendChild(document.createTextNode(': '));
                 item.appendChild(self._domForFailureDiagnosis(builder, historyItem.build, testName, historyItem.result));
index b762cc9..2b3ea90 100644 (file)
@@ -1,3 +1,26 @@
+2011-07-09  Adam Roben  <aroben@apple.com>
+
+        Teach TestFailures to abbreviate the examples of test flakiness
+
+        These lists can get quite long, and it's not really helpful in most cases to have soooooo
+        many examples of flakiness.
+
+        Fixes <http://webkit.org/b/64203> Lists of flaky revisions on TestFailures page can get so
+        long they're hard to navigate
+
+        Reviewed by Dan Bates.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/FlakyLayoutTestDetector.js:
+        (FlakyLayoutTestDetector.prototype.flakinessExamples): If we have more than a certain number
+        of examples, replace the middle items with a separator.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/TestFailures.css:
+        (.flakiness-example-separator): Added styles for the separator.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js:
+        (ViewController.prototype._domForPossiblyFlakyTests): Use a vertical ellipsis to represent
+        the separator.
+
 2011-07-09  Dirk Pranke  <dpranke@chromium.org>
 
         nrwt: stack traces from worker-side exceptions aren't very useful inside test-webkitpy