Make TestFailures never treat a too-many-failures build as a last-passing build for...
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jun 2011 22:28:32 +0000 (22:28 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jun 2011 22:28:32 +0000 (22:28 +0000)
Fixes <http://webkit.org/b/63758> TestFailures sometimes incorrectly says that a build was
the last passing build for a test, when in fact the test wasn't run due to too many failures
causing old-run-webkit-tests to exit early

Reviewed by Anders Carlsson.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js:
(LayoutTestHistoryAnalyzer.prototype._incorporateBuildHistory): If there were too many
failures in this build, assume that all the tests failed in the last build would have failed
in this build, too, had they been run. Introduced some new local variables to reduce typing,
and used them throughout.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js:
(LayoutTestResultsLoader.prototype.start): Fix a regression from r89841 where we wouldn't
correctly remember whether old-run-webkit-tests exited early due to too many failures for
builds older than r89610. Also removed an unused parameter while I was at it.

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

Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js
Tools/ChangeLog

index 2a662b6..bc3aacb 100644 (file)
@@ -117,10 +117,15 @@ LayoutTestHistoryAnalyzer.prototype = {
         self._loader.start(nextBuildName, function(tests, tooManyFailures) {
             ++self._testRunsSinceLastInterestingChange;
 
-            self._history[nextBuildName] = {
+            var historyItem = {
                 tooManyFailures: tooManyFailures,
                 tests: {},
             };
+            self._history[nextBuildName] = historyItem;
+
+            var previousHistoryItem;
+            if (previousBuildName)
+                previousHistoryItem = self._history[previousBuildName];
 
             var newFlakyTests = self._flakinessDetector.incorporateTestResults(nextBuildName, tests, tooManyFailures);
             if (newFlakyTests.length) {
@@ -134,12 +139,22 @@ LayoutTestHistoryAnalyzer.prototype = {
             }
 
             for (var testName in tests) {
-                if (previousBuildName) {
-                    if (!(testName in self._history[previousBuildName].tests))
+                if (previousHistoryItem) {
+                    if (!(testName in previousHistoryItem.tests))
                         continue;
-                    delete self._history[previousBuildName].tests[testName];
+                    delete previousHistoryItem.tests[testName];
+                }
+                historyItem.tests[testName] = tests[testName];
+            }
+
+            if (tooManyFailures && previousHistoryItem) {
+                // Not all tests were run due to too many failures. Just assume that all the tests
+                // that failed in the last build would still have failed in this build had they been
+                // run.
+                for (var testName in previousHistoryItem.tests) {
+                    historyItem.tests[testName] = previousHistoryItem.tests[testName];
+                    delete previousHistoryItem.tests[testName];
                 }
-                self._history[nextBuildName].tests[testName] = tests[testName];
             }
 
             var previousUnexplainedFailuresCount = previousBuildName ? Object.keys(self._history[previousBuildName].tests).length : 0;
index 14029e7..f06ddb7 100644 (file)
@@ -48,7 +48,7 @@ LayoutTestResultsLoader.prototype = {
 
         var self = this;
 
-        function fetchAndParseResultsHTMLAndCallCallback(callback, tooManyFailures) {
+        function fetchAndParseResultsHTMLAndCallCallback(callback) {
             getResource(self._builder.resultsPageURL(buildName), function(xhr) {
                 var root = document.createElement('html');
                 root.innerHTML = xhr.responseText;
@@ -115,6 +115,8 @@ LayoutTestResultsLoader.prototype = {
         }
 
         self._builder.getNumberOfFailingTests(parsedBuildName.buildNumber, function(failingTestCount, tooManyFailures) {
+            result.tooManyFailures = tooManyFailures;
+
             if (failingTestCount < 0) {
                 // The number of failing tests couldn't be determined.
                 PersistentCache.set(cacheKey, result);
index ce082d4..32f0678 100644 (file)
@@ -1,5 +1,26 @@
 2011-06-30  Adam Roben  <aroben@apple.com>
 
+        Make TestFailures never treat a too-many-failures build as a last-passing build for a test
+
+        Fixes <http://webkit.org/b/63758> TestFailures sometimes incorrectly says that a build was
+        the last passing build for a test, when in fact the test wasn't run due to too many failures
+        causing old-run-webkit-tests to exit early
+
+        Reviewed by Anders Carlsson.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js:
+        (LayoutTestHistoryAnalyzer.prototype._incorporateBuildHistory): If there were too many
+        failures in this build, assume that all the tests failed in the last build would have failed
+        in this build, too, had they been run. Introduced some new local variables to reduce typing,
+        and used them throughout.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestResultsLoader.js:
+        (LayoutTestResultsLoader.prototype.start): Fix a regression from r89841 where we wouldn't
+        correctly remember whether old-run-webkit-tests exited early due to too many failures for
+        builds older than r89610. Also removed an unused parameter while I was at it.
+
+2011-06-30  Adam Roben  <aroben@apple.com>
+
         Make TestFaiulres only load old-results directories as needed
 
         Fixes <http://webkit.org/b/63752> Tester pages on TestFailures page load very slowly