Title: [89924] trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures

Diff

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js (89923 => 89924)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js	2011-06-28 14:22:44 UTC (rev 89923)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/LayoutTestHistoryAnalyzer.js	2011-06-28 14:33:39 UTC (rev 89924)
@@ -25,8 +25,13 @@
 
 function LayoutTestHistoryAnalyzer(builder) {
     this._builder = builder;
-    this._history = {};
     this._loader = new LayoutTestResultsLoader(builder);
+
+    this._currentlyFailing = {};
+    this._lastSeenFailing = {};
+    this._lastSeenPassing = {};
+    this._possiblyFlaky = {};
+    this._testRunsSinceLastChange = 0;
 }
 
 LayoutTestHistoryAnalyzer.prototype = {
@@ -62,7 +67,7 @@
                     var nextIndex = buildIndex + 1;
                     if (nextIndex >= buildNames.length)
                         callAgain = false;
-                    callback(self._history, callAgain);
+                    callback(self._currentlyFailing, self._lastSeenFailing, self._lastSeenPassing, self._possiblyFlaky, buildNames[buildIndex], callAgain);
                     if (!callAgain)
                         return;
                     setTimeout(function() { inner(nextIndex) }, 0);
@@ -73,26 +78,46 @@
     },
 
     _incorporateBuildHistory: function(buildNames, buildIndex, callback) {
-        var previousBuildName = Object.keys(this._history).last();
-        var nextBuildName = buildNames[buildIndex];
-
         var self = this;
-        self._loader.start(nextBuildName, function(tests, tooManyFailures) {
-            self._history[nextBuildName] = {
-                tooManyFailures: tooManyFailures,
-                tests: {},
-            };
+        self._loader.start(buildNames[buildIndex], function(tests, tooManyFailures) {
+            ++self._testRunsSinceLastChange;
 
+            if (!Object.keys(self._currentlyFailing).length) {
+                for (var testName in tests)
+                    self._currentlyFailing[testName] = tests[testName];
+            }
+
             for (var testName in tests) {
-                if (previousBuildName) {
-                    if (!(testName in self._history[previousBuildName].tests))
-                        continue;
-                    delete self._history[previousBuildName].tests[testName];
+                if (testName in self._possiblyFlaky) {
+                    self._possiblyFlaky[testName] = tests[testName];
+                    continue;
                 }
-                self._history[nextBuildName].tests[testName] = tests[testName];
+
+                if (testName in self._lastSeenPassing) {
+                    delete self._lastSeenPassing[testName];
+                    self._possiblyFlaky[testName] = tests[testName];
+                    self._testRunsSinceLastChange = 0;
+                    continue;
+                }
+
+                self._lastSeenFailing[testName] = tests[testName];
             }
 
-            callback(Object.keys(self._history[nextBuildName].tests).length);
+            var anyOriginalTestsWereFailing = Object.keys(self._currentlyFailing).some(function(testName) { return testName in self._lastSeenFailing });
+
+            for (var testName in self._lastSeenFailing) {
+                if (testName in tests)
+                    continue;
+                delete self._lastSeenFailing[testName];
+                self._lastSeenPassing[testName] = tests[testName];
+            }
+
+            var anyOriginalTestsAreFailing = Object.keys(self._currentlyFailing).some(function(testName) { return testName in self._lastSeenFailing });
+
+            if (anyOriginalTestsWereFailing && !anyOriginalTestsAreFailing)
+                self._testRunsSinceLastChange = 0;
+
+            callback(anyOriginalTestsAreFailing || self._testRunsSinceLastChange < 5);
         },
         function(tests) {
             // Some tests failed, but we couldn't fetch results.html (perhaps because the test

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js (89923 => 89924)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js	2011-06-28 14:22:44 UTC (rev 89923)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/Utilities.js	2011-06-28 14:33:39 UTC (rev 89924)
@@ -103,6 +103,12 @@
     return result.join(separator);
 }
 
+function sorted(array) {
+    var newArray = array.slice();
+    newArray.sort();
+    return newArray;
+}
+
 Array.prototype.findFirst = function(predicate) {
     for (var i = 0; i < this.length; ++i) {
         if (predicate(this[i]))

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js (89923 => 89924)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js	2011-06-28 14:22:44 UTC (rev 89923)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ViewController.js	2011-06-28 14:33:39 UTC (rev 89924)
@@ -48,9 +48,35 @@
 
     _displayBuilder: function(builder) {
         var self = this;
-        (new LayoutTestHistoryAnalyzer(builder)).start(function(history, stillFetchingData) {
-            var list = document.createElement('ol');
+        (new LayoutTestHistoryAnalyzer(builder)).start(function(currentlyFailing, lastSeenFailing, lastSeenPassing, possiblyFlaky, buildName, stillFetchingData) {
+            var list = document.createElement('ul');
             list.id = 'failure-history';
+            var item = document.createElement('li');
+            list.appendChild(item);
+            item.appendChild(document.createTextNode(buildName));
+
+            var lists = {
+                'Currently Failing': currentlyFailing,
+                'Last Seen Failing': lastSeenFailing,
+                'Last Seen Passing': lastSeenPassing,
+                'Possibly Flaky': possiblyFlaky,
+            };
+
+            for (var listLabel in lists) {
+                var item = document.createElement('li');
+                list.appendChild(item);
+                item.appendChild(document.createTextNode(listLabel));
+                var testList = document.createElement('ol');
+                item.appendChild(testList);
+                testList.appendChildren(sorted(Object.keys(lists[listLabel])).map(function(test) {
+                    var item = document.createElement('li');
+                    item.appendChild(document.createTextNode(test));
+                    return item;
+                }));
+                if (!stillFetchingData)
+                    item.appendChild(self._domForNewAndExistingBugs(builder, buildName, null, Object.keys(lists[listLabel])));
+            }
+            /*
             Object.keys(history).forEach(function(buildName, buildIndex, buildNameArray) {
                 var failingTestNames = Object.keys(history[buildName].tests);
                 if (!failingTestNames.length)
@@ -85,6 +111,7 @@
                 if (passingBuildName || !stillFetchingData)
                     item.appendChild(self._domForNewAndExistingBugs(builder, buildName, passingBuildName, failingTestNames));
             });
+            */
 
             var header = document.createElement('h1');
             header.appendChild(document.createTextNode(builder.name));
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to