Changeset 92166 in webkit


Ignore:
Timestamp:
Aug 1, 2011 8:47:48 PM (13 years ago)
Author:
abarth@webkit.org
Message:

garden-o-matic should call optimize-baselines when rebaselining tests
https://bugs.webkit.org/show_bug.cgi?id=65499

Reviewed by Dimitri Glazkov.

I took the opportunity to modernize this code to use some of our more
powerful primitives from base.

  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/base.js:
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/base_unittests.js:
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/checkout.js:
  • Scripts/webkitpy/tool/servers/gardeningserver.py:
  • Scripts/webkitpy/tool/servers/gardeningserver_unittest.py:
Location:
trunk/Tools
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/base.js

    r91677 r92166  
    135135};
    136136
    137 base.callInSequence = function(functionList, callback)
     137base.callInSequence = function(func, argumentList, callback)
    138138{
    139139    var nextIndex = 0;
     
    141141    function callNext()
    142142    {
    143         if (nextIndex >= functionList.length)
     143        if (nextIndex >= argumentList.length) {
    144144            callback();
    145 
    146         functionList[nextIndex].call(null, callNext);
     145            return;
     146        }
     147
     148        func(argumentList[nextIndex++], callNext);
    147149    }
    148150
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/base_unittests.js

    r91519 r92166  
    4747    deepEqual(base.keys({"a": 1, "b": 0}), ["a", "b"]);
    4848    deepEqual(base.keys({"a": 1, "b": { "c" : 1}}), ["a", "b"]);
     49});
     50
     51test("callInParallel", 4, function() {
     52    var expectedCall = [true, true, true];
     53    var expectCompletionCallback = true;
     54
     55    base.callInParallel([
     56        function(callback) {
     57            ok(expectedCall[0]);
     58            expectedCall[0] = false;
     59            callback();
     60        },
     61        function(callback) {
     62            ok(expectedCall[1]);
     63            expectedCall[1] = false;
     64            callback();
     65        },
     66        function(callback) {
     67            ok(expectedCall[2]);
     68            expectedCall[2] = false;
     69            callback();
     70        },
     71    ], function() {
     72        ok(expectCompletionCallback);
     73        expectCompletionCallback = false;
     74    })
     75});
     76
     77test("callInSequence", 7, function() {
     78    var expectedArg = 42;
     79    var expectCompletionCallback = true;
     80
     81    base.callInSequence(function(arg, callback) {
     82        ok(arg < 45);
     83        equals(arg, expectedArg++);
     84        callback();
     85    }, [42, 43, 44], function() {
     86        ok(expectCompletionCallback);
     87        expectCompletionCallback = false;
     88    })
    4989});
    5090
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/checkout.js

    r91519 r92166  
    1515}
    1616
    17 checkout.existsAtRevision = function (subversionURL, revision, callback)
     17checkout.existsAtRevision = function(subversionURL, revision, callback)
    1818{
    1919    $.ajax({
     
    2929};
    3030
     31checkout.optimizeBaselines = function(testName, callback)
     32{
     33    $.post('/optimizebaselines?' + $.param({
     34        'test': testName,
     35    }), function() {
     36        callback();
     37    });
     38};
     39
    3140checkout.rebaseline = function(builderName, testName, failureTypeList, callback)
    3241{
    33     var extensionList = [];
     42    var extensionList = Array.prototype.concat.apply([], failureTypeList.map(results.failureTypeToExtensionList));
    3443
    35     $.each(failureTypeList, function(index, failureType) {
    36         extensionList = extensionList.concat(results.failureTypeToExtensionList(failureType));
    37     });
    38 
    39     if (!extensionList.length)
    40         callback();
    41 
    42     var requestTracker = new base.RequestTracker(extensionList.length, callback);
    43 
    44     $.each(extensionList, function(index, extension) {
     44    base.callInSequence(function(extension, callback) {
    4545        $.post('/rebaseline?' + $.param({
    4646            'builder': builderName,
    4747            'test': testName,
    48             // FIXME: Rename "suffix" query parameter to "extension".
    49             'suffix': extension
     48            'extension': extension
    5049        }), function() {
    51             requestTracker.requestComplete();
     50            callback();
    5251        });
    53     });
     52    }, extensionList, callback);
    5453};
    5554
    5655checkout.rebaselineAll = function(rebaselineTasks, callback)
    5756{
    58     var nextIndex = 0;
    59 
    60     function rebaselineNext()
    61     {
    62         if (nextIndex >= rebaselineTasks.length) {
    63             callback();
    64             return;
    65         }
    66         var task = rebaselineTasks[nextIndex++];
    67         checkout.rebaseline(task.builderName, task.testName, task.failureTypeList, rebaselineNext);
    68     }
    69 
    70     rebaselineNext();
     57    base.callInSequence(function(task, callback) {
     58        checkout.rebaseline(task.builderName, task.testName, task.failureTypeList, callback);
     59    }, rebaselineTasks, function() {
     60        var testNameList = base.uniquifyArray(rebaselineTasks.map(function(task) { return task.testName; }));
     61        base.callInSequence(checkout.optimizeBaselines, testNameList, callback);
     62    });
    7163};
    7264
  • trunk/Tools/ChangeLog

    r92160 r92166  
     12011-08-01  Adam Barth  <abarth@webkit.org>
     2
     3        garden-o-matic should call optimize-baselines when rebaselining tests
     4        https://bugs.webkit.org/show_bug.cgi?id=65499
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        I took the opportunity to modernize this code to use some of our more
     9        powerful primitives from base.
     10
     11        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/base.js:
     12        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/base_unittests.js:
     13        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/checkout.js:
     14        * Scripts/webkitpy/tool/servers/gardeningserver.py:
     15        * Scripts/webkitpy/tool/servers/gardeningserver_unittest.py:
     16
    1172011-08-01  Stephanie Lewis  <slewis@apple.com>
    218
  • trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py

    r92137 r92166  
    8484        builder = self.query['builder'][0]
    8585        test = self.query['test'][0]
    86         suffix = self.query['suffix'][0]
     86        extension = self.query['extension'][0]
    8787        self._run_webkit_patch([
    8888            'rebaseline-test',
    8989            builder,
    9090            test,
    91             suffix,
     91            extension,
    9292        ])
    9393        self._serve_text('success')
     94
     95    def optimizebaselines(self):
     96        test = self.query['test'][0]
     97        self._run_webkit_patch([
     98            'optimize-baselines',
     99            test,
     100        ])
     101        self._serve_text('success')
  • trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py

    r92137 r92166  
    7878        expected_stderr = "MOCK run_command: ['echo', 'rebaseline-test', 'MOCK builder', 'user-scripts/another-test.html', 'txt'], cwd=/mock-checkout\n"
    7979        expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n"
    80         self._post_to_path("/rebaseline?builder=MOCK+builder&test=user-scripts/another-test.html&suffix=txt", expected_stderr=expected_stderr, expected_stdout=expected_stdout)
     80        self._post_to_path("/rebaseline?builder=MOCK+builder&test=user-scripts/another-test.html&extension=txt", expected_stderr=expected_stderr, expected_stdout=expected_stdout)
     81
     82    def test_optimizebaselines(self):
     83        expected_stderr = "MOCK run_command: ['echo', 'optimize-baselines', 'user-scripts/another-test.html'], cwd=/mock-checkout\n"
     84        expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n"
     85        self._post_to_path("/optimizebaselines?test=user-scripts/another-test.html", expected_stderr=expected_stderr, expected_stdout=expected_stdout)
Note: See TracChangeset for help on using the changeset viewer.