Title: [118234] trunk/Tools
Revision
118234
Author
[email protected]
Date
2012-05-23 13:35:48 -0700 (Wed, 23 May 2012)

Log Message

garden-o-matic should not fetch from debug bots if it also knows about the release bots
https://bugs.webkit.org/show_bug.cgi?id=86916

Reviewed by Adam Barth.

This change pushes all of the logic for rebaselining a cluster
of failures (a list of tests failing a list of suffixes on a
list of bots) onto the server, so there is a single call from
the web page; we will then be able to optimize the performance
of the rebaselining better.

Also remove the 'optimizebaseline' entry point on garden-o-matic
(and the client-side call) since we don't need it any more.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js:
* Scripts/webkitpy/tool/servers/gardeningserver.py:
(GardeningHTTPRequestHandler.rebaselineall):
* Scripts/webkitpy/tool/servers/gardeningserver_unittest.py:

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout.js (118233 => 118234)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout.js	2012-05-23 20:30:24 UTC (rev 118233)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout.js	2012-05-23 20:35:48 UTC (rev 118234)
@@ -75,18 +75,6 @@
     }, checkoutUnavailable);
 };
 
-checkout.optimizeBaselines = function(testName, suffixes, callback, checkoutUnavailable)
-{
-    callIfCheckoutAvailable(function() {
-        net.post(config.kLocalServerURL + '/optimizebaselines?' + $.param({
-            'test': testName,
-            'suffixes': suffixes,
-        }), function() {
-            callback();
-        });
-    }, checkoutUnavailable);
-};
-
 checkout.rollout = function(revision, reason, callback, checkoutUnavailable)
 {
     callIfCheckoutAvailable(function() {
@@ -102,26 +90,14 @@
 checkout.rebaseline = function(failureInfoList, callback, progressCallback, checkoutUnavailable)
 {
     callIfCheckoutAvailable(function() {
-        base.callInSequence(function(failureInfo, callback) {
-            var suffixes = base.uniquifyArray(base.flattenArray(failureInfo.failureTypeList.map(results.failureTypeToExtensionList))).join(',');
-
-            net.post(config.kLocalServerURL + '/rebaseline?' + $.param({
-                'builder': failureInfo.builderName,
-                'test': failureInfo.testName,
-                'suffixes': suffixes,
-            }), function() {
-                if (progressCallback)
-                    progressCallback(failureInfo);
-                callback();
-            });
-        }, failureInfoList, function() {
-            var testNameList = base.uniquifyArray(failureInfoList.map(function(failureInfo) { return failureInfo.testName; }));
-            var suffixes = base.uniquifyArray(base.flattenArray(
-                failureInfoList.map(function(failureInfo) {
-                    return base.flattenArray(failureInfo.failureTypeList.map(results.failureTypeToExtensionList))
-                }))).join(',');
-            base.callInSequence(function(testName, callback) { checkout.optimizeBaselines(testName, suffixes, callback)}, testNameList, callback);
-        });
+        var tests = {};
+        for (var i = 0; i < failureInfoList.length; i++) {
+            var failureInfo = failureInfoList[i];
+            tests[failureInfo.testName] = tests[failureInfo.testName] || {};
+            tests[failureInfo.testName][failureInfo.builderName] = 
+                base.uniquifyArray(base.flattenArray(failureInfo.failureTypeList.map(results.failureTypeToExtensionList)));
+        }
+        net.post(config.kLocalServerURL + '/rebaselineall', JSON.stringify(tests), function() { callback() });
     }, checkoutUnavailable);
 };
 

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js (118233 => 118234)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js	2012-05-23 20:30:24 UTC (rev 118233)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js	2012-05-23 20:35:48 UTC (rev 118234)
@@ -56,28 +56,13 @@
     });
 });
 
-test("optimizeBaselines", 3, function() {
+test("rebaseline", 4, function() {
     var simulator = new NetworkSimulator();
-    simulator.post = function(url, callback)
-    {
-        equals(url, 'http://127.0.0.1:8127/optimizebaselines?test=another%2Ftest.svg&suffixes=txt%2Cpng');
-        simulator.scheduleCallback(callback);
-    };
 
-    simulator.runTest(function() {
-        checkout.optimizeBaselines('another/test.svg', 'txt,png', function() {
-            ok(true);
-        });
-    });
-});
-
-test("rebaseline", 6, function() {
-    var simulator = new NetworkSimulator();
-
-    var requestedURLs = [];
-    simulator.post = function(url, callback)
+    var requests = [];
+    simulator.post = function(url, body, callback)
     {
-        requestedURLs.push(url);
+        requests.push([url, body]);
         simulator.scheduleCallback(callback);
     };
     simulator.ajax = function(options)
@@ -115,12 +100,15 @@
         });
     });
 
-    deepEqual(requestedURLs, [
-        "http://127.0.0.1:8127/rebaseline?builder=WebKit+Linux&test=another%2Ftest.svg&suffixes=png",
-        "http://127.0.0.1:8127/rebaseline?builder=WebKit+Mac10.6&test=another%2Ftest.svg&suffixes=png%2Ctxt",
-        "http://127.0.0.1:8127/rebaseline?builder=Webkit+Vista&test=fast%2Ftest.html&suffixes=txt%2Cpng",
-        "http://127.0.0.1:8127/optimizebaselines?test=another%2Ftest.svg&suffixes=png%2Ctxt",
-        "http://127.0.0.1:8127/optimizebaselines?test=fast%2Ftest.html&suffixes=png%2Ctxt"
+    deepEqual(requests, [
+        ["http://127.0.0.1:8127/rebaselineall",
+         JSON.stringify({
+             "another/test.svg": {
+                 "WebKit Linux": ["png"], 
+                 "WebKit Mac10.6": ["png","txt"]},
+             "fast/test.html": {
+                 "Webkit Vista": ["txt","png"]
+             }})]
     ]);
 });
 

Modified: trunk/Tools/ChangeLog (118233 => 118234)


--- trunk/Tools/ChangeLog	2012-05-23 20:30:24 UTC (rev 118233)
+++ trunk/Tools/ChangeLog	2012-05-23 20:35:48 UTC (rev 118234)
@@ -1,3 +1,25 @@
+2012-05-23  Dirk Pranke  <[email protected]>
+
+        garden-o-matic should not fetch from debug bots if it also knows about the release bots
+        https://bugs.webkit.org/show_bug.cgi?id=86916
+
+        Reviewed by Adam Barth.
+
+        This change pushes all of the logic for rebaselining a cluster
+        of failures (a list of tests failing a list of suffixes on a
+        list of bots) onto the server, so there is a single call from
+        the web page; we will then be able to optimize the performance
+        of the rebaselining better.
+
+        Also remove the 'optimizebaseline' entry point on garden-o-matic
+        (and the client-side call) since we don't need it any more.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout.js:
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js:
+        * Scripts/webkitpy/tool/servers/gardeningserver.py:
+        (GardeningHTTPRequestHandler.rebaselineall):
+        * Scripts/webkitpy/tool/servers/gardeningserver_unittest.py:
+
 2012-05-21  Ryosuke Niwa  <[email protected]>
 
         Mac DRT should be able to load external URLs for replay performance tests

Modified: trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py (118233 => 118234)


--- trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py	2012-05-23 20:30:24 UTC (rev 118233)
+++ trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py	2012-05-23 20:35:48 UTC (rev 118234)
@@ -150,15 +150,13 @@
         self._run_webkit_patch(command)
         self._serve_text('success')
 
-    def optimizebaselines(self):
-        test = self.query['test'][0]
-        command = [ 'optimize-baselines']
-
-        if 'suffixes' in self.query:
-            command.append('--suffixes')
-            command.append(self.query['suffixes'][0])
-
-        command.append(test)
-        self._run_webkit_patch(command)
-
+    def rebaselineall(self):
+        # FIXME: Optimize this to de-dup bot results, run in parallel, cache zips, etc.
+        test_list = self._read_entity_body_as_json()
+        for test in test_list:
+            all_suffixes = set()
+            for builder, suffixes in test_list[test].iteritems():
+                all_suffixes.update(set(suffixes))
+                self._run_webkit_patch(['rebaseline-test', '--suffixes', ','.join(suffixes), builder, test])
+            self._run_webkit_patch(['optimize-baselines', '--suffixes', ','.join(all_suffixes), test])
         self._serve_text('success')

Modified: trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py (118233 => 118234)


--- trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py	2012-05-23 20:30:24 UTC (rev 118233)
+++ trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py	2012-05-23 20:35:48 UTC (rev 118234)
@@ -181,11 +181,11 @@
         expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n"
         self._post_to_path("/rollout?revision=2314&reason=MOCK+rollout+reason", expected_stderr=expected_stderr, expected_stdout=expected_stdout)
 
-    def test_rebaseline(self):
+    def test_rebaselineall(self):
         builders._exact_matches = {"MOCK builder": {"port_name": "mock-port-name", "specifiers": set(["mock-specifier"])}}
-        expected_stderr = "MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt,png', 'MOCK builder', 'user-scripts/another-test.html'], cwd=/mock-checkout\n"
+        expected_stderr = "MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', u'txt,png', u'MOCK builder', u'user-scripts/another-test.html'], cwd=/mock-checkout\nMOCK run_command: ['echo', 'optimize-baselines', '--suffixes', u'txt,png', u'user-scripts/another-test.html'], cwd=/mock-checkout\n"
         expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n"
-        self._post_to_path("/rebaseline?builder=MOCK+builder&test=user-scripts/another-test.html&suffixes=txt,png", expected_stderr=expected_stderr, expected_stdout=expected_stdout)
+        self._post_to_path("/rebaselineall", body='{"user-scripts/another-test.html":{"MOCK builder": ["txt","png"]}}', expected_stderr=expected_stderr, expected_stdout=expected_stdout)
 
     def test_rebaseline_new_port(self):
         builders._exact_matches = {"MOCK builder": {"port_name": "mock-port-name", "specifiers": set(["mock-specifier"]), "move_overwritten_baselines_to": ["mock-port-fallback", "mock-port-fallback2"]}}
@@ -193,11 +193,6 @@
         expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n"
         self._post_to_path("/rebaseline?builder=MOCK+builder&test=user-scripts/another-test.html&suffixes=txt,png", expected_stderr=expected_stderr, expected_stdout=expected_stdout)
 
-    def test_optimizebaselines(self):
-        expected_stderr = "MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt,png', 'user-scripts/another-test.html'], cwd=/mock-checkout\n"
-        expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n"
-        self._post_to_path("/optimizebaselines?test=user-scripts/another-test.html&suffixes=txt,png", expected_stderr=expected_stderr, expected_stdout=expected_stdout)
-
     def test_updateexpectations(self):
         expected_stderr = ""
         expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n"
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to