Changeset 93236 in webkit


Ignore:
Timestamp:
Aug 17, 2011 1:15:59 PM (13 years ago)
Author:
abarth@webkit.org
Message:

garden-o-matic should be able to rebaseline expected failures
https://bugs.webkit.org/show_bug.cgi?id=66204

Reviewed by Dimitri Glazkov.

This patch introduces a new view for displaying expect, actual, and
differences between results. The new view also has a fledgling
controller that handles some basic operations. The new view is
exercised by rebaseline.html, which lets you rebaselines expected
failures, but the new view is not fully integrated into
garden-o-matic.html

More patches will be required to make this stuff fully working, but
this patch was already somewhat spiraling out of control. Hopefully
this patch will serve as a good starting point for further development.

  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/controllers: Added.
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/controllers.js: Added.
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/controllers/rebaseline.js: Added.
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html:
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.css:
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.js:
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/rebaseline.html: Added.
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/results.js:
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html:
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ui.js:
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ui/results.js:
  • BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ui/results_unittests.js: Added.
Location:
trunk/Tools
Files:
5 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html

    r93029 r93236  
    4040</div>
    4141<div class="recent-history"></div>
    42 <div class="results-detail">
     42<div class="results-detail results-view old-results-view">
    4343    <div class="toolbar">
    4444        <div class="actions">
     
    6262<script src="ui/results.js"></script>
    6363<script src="model.js"></script>
     64<script src="controllers.js"></script>
    6465<script src="main.js"></script>
    6566</body>
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.css

    r93029 r93236  
    272272}
    273273
    274 /*** results-detail ***/
    275 
    276 .results-detail {
     274/*** results-view ***/
     275
     276/* FIXME: Remove this once garden-o-matic switches to the new results view. */
     277.old-results-view {
    277278    display: none;
    278279    position: fixed;
    279     background-color: #f5f5f5;
    280     top: 25%;
    281280    left: 0px;
    282281    right: 0px;
     282    top: 25%;
    283283    bottom: 0px;
    284284}
    285285
    286 .results-detail .toolbar {
     286.results-view {
     287    background-color: #f5f5f5;
     288}
     289
     290.results-view .toolbar {
    287291    border-top: 1px solid #c6c6c6;
    288292    border-bottom: 1px solid #c6c6c6;
    289293}
    290294
    291 .results-detail .toolbar .status {
     295.results-view .toolbar .selector {
    292296    font-size: 11px;
    293297    font-weight: bold;
     
    298302}
    299303
    300 .results-detail .toolbar .status .builder-name {
    301     font-weight: normal;
    302     padding-left: 20px;
    303 }
    304 
    305 .results-detail .toolbar .status .selected {
    306     font-style: italic;
    307 }
    308 
    309 .results-detail .toolbar .actions {
     304.results-view .test-selector {
     305    width: 400px;
     306    margin-right: 6px;
     307}
     308
     309.results-view .toolbar .actions {
    310310    float: right;
    311311}
    312312
    313 .results-detail .content {
     313.results-detail td {
    314314    background-color: white;
    315315}
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.js

    r93029 r93236  
    172172        'builderName': failureDetails.attr(config.kBuilderNameAttr),
    173173        'testName': failureDetails.attr(config.kTestNameAttr),
    174         'failureTypeList': failureDetails.attr(config.kFailureTypesAttr).split(' '),
     174        'failureTypeList': results.failureTypeList(failureDetails.attr(config.kFailureTypesAttr)),
    175175    }
    176176}
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/results.js

    r92875 r93236  
    164164};
    165165
     166results.failureTypeList = function(failureBlob)
     167{
     168    return failureBlob.split(' ');
     169};
     170
    166171results.canRebaseline = function(failureTypeList)
    167172{
     
    206211results.unexpectedResults = function(resultNode)
    207212{
    208     var actualResults = resultNode.actual.split(' ');
    209     var expectedResults = addImpliedExpectations(resultNode.expected.split(' '))
     213    var actualResults = results.failureTypeList(resultNode.actual);
     214    var expectedResults = addImpliedExpectations(results.failureTypeList(resultNode.expected))
    210215
    211216    return $.grep(actualResults, function(result) {
     
    214219};
    215220
     221function isExpectedOrUnexpectedFailure(resultNode)
     222{
     223    if (!resultNode)
     224        return false;
     225    var actualResults = results.failureTypeList(resultNode.actual);
     226    if (anyIsSuccess(actualResults))
     227        return false;
     228    return anyIsFailure(actualResults);
     229}
     230
    216231function isUnexpectedFailure(resultNode)
    217232{
    218233    if (!resultNode)
    219234        return false;
    220     if (anyIsSuccess(resultNode.actual.split(' ')))
     235    if (anyIsSuccess(results.failureTypeList(resultNode.actual)))
    221236        return false;
    222237    return anyIsFailure(results.unexpectedResults(resultNode));
     
    227242    if (!resultNode)
    228243        return false;
    229     if (anyIsFailure(resultNode.actual.split(' ')))
     244    if (anyIsFailure(results.failureTypeList(resultNode.actual)))
    230245        return false;
    231246    return anyIsSuccess(results.unexpectedResults(resultNode));
     
    236251    return !!node.actual;
    237252}
     253
     254results.expectedOrUnexpectedFailures = function(resultsTree)
     255{
     256    return base.filterTree(resultsTree.tests, isResultNode, isExpectedOrUnexpectedFailure);
     257};
    238258
    239259results.unexpectedFailures = function(resultsTree)
     
    260280    return resultsByTest;
    261281}
     282
     283results.expectedOrUnexpectedFailuresByTest = function(resultsByBuilder)
     284{
     285    return resultsByTest(resultsByBuilder, results.expectedOrUnexpectedFailures);
     286};
    262287
    263288results.unexpectedFailuresByTest = function(resultsByBuilder)
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html

    r93152 r93236  
    2828<link rel="stylesheet" href="../../../../../Source/ThirdParty/qunit/qunit/qunit.css">
    2929<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
     30<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.min.js"></script>
    3031<script src="../../../../../Source/ThirdParty/qunit/qunit/qunit.js"></script>
    3132</head>
     
    5455<script src="ui.js"></script>
    5556<script src="ui/results.js"></script>
     57<script src="controllers.js"></script> <!-- This script is slightly of order. -->
     58<script src="ui/results_unittests.js"></script>
    5659<script src="ui_unittests.js"></script>
    5760<script src="model.js"></script>
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ui.js

    r93029 r93236  
    2828(function () {
    2929
    30 function displayURLForBuilder(builderName)
     30ui.displayURLForBuilder = function(builderName)
    3131{
    3232    return 'http://build.chromium.org/p/chromium.webkit/waterfall?' + $.param({
     
    3535}
    3636
    37 function displayNameForBuilder(builderName)
     37ui.displayNameForBuilder = function(builderName)
    3838{
    3939    return builderName.replace(/Webkit /, '');
     
    5858        var listElement = $('<li><a target="_blank"></a></li>');
    5959        list.append(listElement);
    60         $('a', listElement).attr('href', displayURLForBuilder(builderName)).text(displayNameForBuilder(builderName));
     60        $('a', listElement).attr('href', ui.displayURLForBuilder(builderName)).text(ui.displayNameForBuilder(builderName));
    6161    });
    6262
     
    9292    $.each(config.kBuilders, function(index, builderName) {
    9393        var block = $('<td class="builder"></td>');
    94         block.attr('title', displayNameForBuilder(builderName));
     94        block.attr('title', ui.displayNameForBuilder(builderName));
    9595        block.attr(config.kBuilderNameAttr, builderName);
    9696
     
    133133        if (!failureTypes)
    134134            return
    135         var failureTypeList = failureTypes.split(' ');
     135        var failureTypeList = results.failureTypeList(failureTypes);
    136136        var builderName = $(this).attr(config.kBuilderNameAttr);
    137137        failureInfoList.push({
  • trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ui/results.js

    r93029 r93236  
     1/*
     2 * Copyright (C) 2011 Google Inc. All rights reserved.
     3 *
     4 * Redistribution and use in source and binary forms, with or without
     5 * modification, are permitted provided that the following conditions
     6 * are met:
     7 * 1. Redistributions of source code must retain the above copyright
     8 *    notice, this list of conditions and the following disclaimer.
     9 * 2. Redistributions in binary form must reproduce the above copyright
     10 *    notice, this list of conditions and the following disclaimer in the
     11 *    documentation and/or other materials provided with the distribution.
     12 *
     13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
     14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
     17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     23 * THE POSSIBILITY OF SUCH DAMAGE.
     24 */
     25
    126var ui = ui || {};
    227ui.results = ui.results || {};
     
    112137});
    113138
     139ui.results.ResultsDetails = base.extends('div', {
     140    init: function(delegate)
     141    {
     142        this.className = 'results-detail';
     143        this._delegate = delegate;
     144    },
     145    show: function(failureInfo) {
     146        this._delegate.fetchResultsURLs(failureInfo, function(resultsURLs) {
     147            var resultsGrid = new ui.results.ResultsGrid();
     148            resultsGrid.addResults(resultsURLs);
     149            $(this).empty().append(resultsGrid);
     150        }.bind(this));
     151    },
     152});
     153
     154ui.results.TestSelector = base.extends('input', {
     155    init: function()
     156    {
     157        this.className = 'test-selector';
     158        this.type = 'text';
     159        this.placeholder = 'Test name';
     160    },
     161    setTestList: function(testNameList)
     162    {
     163        $(this).autocomplete({
     164            source: testNameList,
     165            select: function(event, selected) {
     166                $(this).trigger('testselected', [selected.item.value]);
     167            }.bind(this)
     168        });
     169    }
     170});
     171
     172ui.results.BuilderSelector = base.extends('select', {
     173    init: function()
     174    {
     175        this.className = 'builder-selector';
     176        $(this).hide();
     177        $(this).change(function() {
     178            $(this).trigger('builderselected');
     179        }.bind(this));
     180    },
     181    show: function(builderNameList) {
     182        $(this).empty();
     183        $(this).show();
     184        builderNameList.forEach(function(builderName) {
     185            var builderElement = document.createElement('option');
     186            builderElement.textContent = ui.displayNameForBuilder(builderName);
     187            builderElement.value = builderName;
     188            this.appendChild(builderElement);
     189        }.bind(this));
     190    },
     191    select: function(builderName) {
     192        var builderIndex = -1;
     193        for (var i = 0; i < this.options.length; ++i) {
     194            if (this.options[i].value == builderName) {
     195                builderIndex = i;
     196                break;
     197            }
     198        }
     199        if (builderIndex == -1)
     200            return;
     201        this.selectedIndex = builderIndex;
     202    },
     203    selectedBuilder: function() {
     204        if (this.selectedIndex == -1)
     205            return;
     206        return this.options[this.selectedIndex].value;
     207    }
     208});
     209
     210ui.results.Actions = base.extends('div', {
     211    init: function()
     212    {
     213        this.className = 'actions';
     214        this.innerHTML = '<button class="rebaseline default">Rebaseline</button>' +
     215                         '<button class="previous">&#9664;</button>' +
     216                         '<button class="next">&#9654;</button>';
     217        this._routeClickEvent('.rebaseline', 'rebaseline');
     218        this._routeClickEvent('.previous', 'previous');
     219        this._routeClickEvent('.next', 'next');
     220    },
     221    _routeClickEvent: function(selector, eventName) {
     222        $(selector, this).bind('click', function() {
     223            $(this).trigger(eventName);
     224        }.bind(this));
     225    }
     226});
     227
     228ui.results.View = base.extends('div', {
     229    init: function(delegate)
     230    {
     231        this.className = 'results-view';
     232        this.innerHTML = '<div class="toolbar"><div class="selector"></div></div><div class="content"></div>';
     233
     234        this._testSelector = new ui.results.TestSelector();
     235        this._builderSelector = new ui.results.BuilderSelector();
     236        this._resultsDetails = new ui.results.ResultsDetails(delegate);
     237
     238        $('.toolbar', this).prepend(new ui.results.Actions())
     239        $('.selector', this).append(this._testSelector).append(this._builderSelector);
     240        $('.content', this).append(this._resultsDetails);
     241    },
     242    setTestList: function(testNameList)
     243    {
     244        this._testSelector.setTestList(testNameList);
     245    },
     246    currentTestName: function()
     247    {
     248        return this._testSelector.value;
     249    },
     250    currentBuilderName: function()
     251    {
     252        return this._builderSelector.selectedBuilder();
     253    },
     254    setBuilderList: function(buildNameList)
     255    {
     256        this._builderSelector.show(buildNameList);
     257    },
     258    showResults: function(failureInfo)
     259    {
     260        this._testSelector.value = failureInfo.testName;
     261        this._builderSelector.select(failureInfo.builderName);
     262        this._resultsDetails.show(failureInfo);
     263    }
     264});
     265
    114266})();
  • trunk/Tools/ChangeLog

    r93235 r93236  
     12011-08-17  Adam Barth  <abarth@webkit.org>
     2
     3        garden-o-matic should be able to rebaseline expected failures
     4        https://bugs.webkit.org/show_bug.cgi?id=66204
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        This patch introduces a new view for displaying expect, actual, and
     9        differences between results.  The new view also has a fledgling
     10        controller that handles some basic operations.  The new view is
     11        exercised by rebaseline.html, which lets you rebaselines expected
     12        failures, but the new view is not fully integrated into
     13        garden-o-matic.html
     14
     15        More patches will be required to make this stuff fully working, but
     16        this patch was already somewhat spiraling out of control.  Hopefully
     17        this patch will serve as a good starting point for further development.
     18
     19        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/controllers: Added.
     20        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/controllers.js: Added.
     21        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/controllers/rebaseline.js: Added.
     22        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/garden-o-matic.html:
     23        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.css:
     24        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/main.js:
     25        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/rebaseline.html: Added.
     26        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/results.js:
     27        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/run-unittests.html:
     28        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ui.js:
     29        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ui/results.js:
     30        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/ui/results_unittests.js: Added.
     31
    1322011-08-16  Chang Shu  <cshu@webkit.org>
    233
Note: See TracChangeset for help on using the changeset viewer.