Changeset 92346 in webkit


Ignore:
Timestamp:
Aug 3, 2011 9:16:47 PM (13 years ago)
Author:
abarth@webkit.org
Message:

Add UI to garden-o-matic for updating expectations
https://bugs.webkit.org/show_bug.cgi?id=65644

Reviewed by Dimitri Glazkov.

The patch plumbs the UI back to the gardening server, but the gardening
server endpoint is just a stub at this point.

  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/checkout.js:
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html:
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.js:
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/model.js:
  • Scripts/webkitpy/tool/servers/gardeningserver.py:
  • Scripts/webkitpy/tool/servers/reflectionhandler.py:
Location:
trunk/Tools
Files:
7 edited

Legend:

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

    r92344 r92346  
    2929};
    3030
     31checkout.updateExpectations = function(failureInfoList, callback)
     32{
     33    $.post('/updateexpectations', JSON.stringify(failureInfoList), function() {
     34        callback();
     35    });
     36};
     37
    3138checkout.optimizeBaselines = function(testName, callback)
    3239{
     
    3845};
    3946
    40 checkout.rebaseline = function(rebaselineTasks, callback)
     47checkout.rebaseline = function(failureInfoList, callback)
    4148{
    42     base.callInSequence(function(task, callback) {
    43         var extensionList = Array.prototype.concat.apply([], task.failureTypeList.map(results.failureTypeToExtensionList));
     49    base.callInSequence(function(failureInfo, callback) {
     50        var extensionList = Array.prototype.concat.apply([], failureInfo.failureTypeList.map(results.failureTypeToExtensionList));
    4451        base.callInSequence(function(extension, callback) {
    4552            $.post('/rebaseline?' + $.param({
    46                 'builder': task.builderName,
    47                 'test': task.testName,
     53                'builder': failureInfo.builderName,
     54                'test': failureInfo.testName,
    4855                'extension': extension
    4956            }), function() {
     
    5158            });
    5259        }, extensionList, callback);
    53     }, rebaselineTasks, function() {
    54         var testNameList = base.uniquifyArray(rebaselineTasks.map(function(task) { return task.testName; }));
     60    }, failureInfoList, function() {
     61        var testNameList = base.uniquifyArray(failureInfoList.map(function(failureInfo) { return failureInfo.testName; }));
    5562        base.callInSequence(checkout.optimizeBaselines, testNameList, callback);
    5663    });
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html

    r92344 r92346  
    1616    <button class="show-selected-failures">Show Selected Failures</button>
    1717    <button class="rebaseline-selected">Rebaseline Selected</button>
     18    <button class="add-selected-expectations">Mark Selected as Expected</button>
    1819    <button class="refresh">Refresh</button>
    1920</div>
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.js

    r92344 r92346  
    6060}
    6161
    62 function rebaseline(rebaselineTasks)
     62function rebaseline(failureInfoList)
    6363{
    6464    displayOnButterbar('Rebaselining...');
    65     checkout.rebaseline(rebaselineTasks, function() {
     65    checkout.rebaseline(failureInfoList, function() {
    6666        dismissButterbar();
    6767        // FIXME: We should use something like a lightbox rather than alert!
    6868        alert('New results downloaded to your working copy. Please use "webkit-patch land-cowboy" to land the updated baselines.');
    6969    });
     70}
     71
     72function updateExpectations(failureInfoList)
     73{
     74    displayOnButterbar('Adding expectations...');
     75    checkout.updateExpectations(failureInfoList, dismissButterbar);
    7076}
    7177
     
    110116function executeQueuedRebaselines()
    111117{
    112     var rebaselineQueue = model.takeRebaselineQueue();
    113     if (!rebaselineQueue.length)
     118    var failureInfoList = model.takeRebaselineQueue();
     119    if (!failureInfoList.length)
    114120        return;
    115121    // FIXME: Should we confirm with the use before executing the queue?
    116     rebaseline(rebaselineQueue);
     122    rebaseline(failureInfoList);
    117123}
    118124
     
    157163function selectedFailures()
    158164{
    159     var failures = [];
     165    var failureInfoList = [];
    160166
    161167    $('.test input:checkbox').each(function() {
     
    170176            var failureTypeList = failureTypes.split(' ');
    171177            var builderName = $(this).attr(config.kBuilderNameAttr);
    172             failures.push({
     178            failureInfoList.push({
    173179                'testName': testName,
    174180                'builderName': builderName,
     
    178184    });
    179185
    180     return failures;
     186    return failureInfoList;
    181187}
    182188
     
    186192}
    187193
     194function updateExpectationsForSelected()
     195{
     196    updateExpectations(selectedFailures());
     197}
     198
    188199function showSelectedFailures()
    189200{
    190     var argumentList = selectedFailures().map(function(failureDescription) {
    191         return [failureDescription.testName, failureDescription.builderName, failureDescription.failureTypeList];
     201    var argumentList = selectedFailures().map(function(failureInfo) {
     202        return [failureInfo.testName, failureInfo.builderName, failureInfo.failureTypeList];
    192203    });
    193204    g_resultsDetailsIterator = new base.CallbackIterator(showResultsDetail, argumentList);
     
    266277$('.show-selected-failures').live('click', showSelectedFailures);
    267278$('.rebaseline-selected').live('click', rebaselineSelected);
     279$('.update-expectations-selected').live('click', updateExpectationsForSelected);
    268280$('.refresh').live('click', update);
    269281
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/model.js

    r92344 r92346  
    5858{
    5959    var unexpectedFailures = results.unexpectedFailuresByTest(model.state.resultsByBuilder);
    60     console.log(unexpectedFailures);
    6160
    6261    $.each(model.state.failureAnalysisByTest, function(testName, failureAnalysis) {
  • trunk/Tools/ChangeLog

    r92344 r92346  
     12011-08-03  Adam Barth  <abarth@webkit.org>
     2
     3        Add UI to garden-o-matic for updating expectations
     4        https://bugs.webkit.org/show_bug.cgi?id=65644
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        The patch plumbs the UI back to the gardening server, but the gardening
     9        server endpoint is just a stub at this point.
     10
     11        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/checkout.js:
     12        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html:
     13        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.js:
     14        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/model.js:
     15        * Scripts/webkitpy/tool/servers/gardeningserver.py:
     16        * Scripts/webkitpy/tool/servers/reflectionhandler.py:
     17
    1182011-08-03  Adam Barth  <abarth@webkit.org>
    219
  • trunk/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py

    r92166 r92346  
    8181        self._serve_text('success')
    8282
     83    def updateexpectations(self):
     84        failure_info_list = self._read_entity_body_as_json()
     85        print 'FailureInfoList:', failure_info_list
     86        self._serve_text('success')
     87
    8388    def rebaseline(self):
    8489        builder = self.query['builder'][0]
  • trunk/Tools/Scripts/webkitpy/tool/servers/reflectionhandler.py

    r91167 r92346  
    6161    def do_POST(self):
    6262        self._handle_request()
     63
     64    def _read_entity_body(self):
     65        length = int(self.headers.getheader('content-length'))
     66        return self.rfile.read(length)
     67
     68    def _read_entity_body_as_json(self):
     69        return json.loads(self._read_entity_body())
    6370
    6471    def _handle_request(self):
Note: See TracChangeset for help on using the changeset viewer.