Title: [94722] trunk/Tools
Revision
94722
Author
[email protected]
Date
2011-09-07 16:08:18 -0700 (Wed, 07 Sep 2011)

Log Message

rebaseline button in garden-o-matic details view should work
https://bugs.webkit.org/show_bug.cgi?id=67738

Reviewed by Dimitri Glazkov.

This patch wires up the rebaseline button in garden-o-matic results
details view.  The button is current per-test, so there isn't a way to
rebaseline individual bots.  This is a place to start.  If we decide we
want per-bot rebaselining, we'll need to think of some better UI.

* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/actions.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css:

Modified Paths

Diff

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers.js (94721 => 94722)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers.js	2011-09-07 22:54:48 UTC (rev 94721)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers.js	2011-09-07 23:08:18 UTC (rev 94722)
@@ -36,6 +36,7 @@
 
         $(this._view).bind('next', this.onNext.bind(this));
         $(this._view).bind('previous', this.onPrevious.bind(this));
+        $(this._view).bind('rebaseline', this.onRebaseline.bind(this));
     },
     onNext: function()
     {
@@ -44,6 +45,20 @@
     onPrevious: function()
     {
         this._view.previousResult();
+    },
+    onRebaseline: function()
+    {
+        var testName = this._view.currentTestName();
+        var failureInfoList = Object.keys(this._resultsByTest[testName]).map(function(builderName) {
+            return {
+                'testName': testName,
+                'builderName': builderName
+            }
+        });
+        checkout.rebaseline(failureInfoList, function() {
+            // FIXME: We should have a better dialog than this!
+            alert('Rebaseline done! Please land with "webkit-patch land-cowboy".');
+        });
     }
 });
 
@@ -103,7 +118,7 @@
     },
     onRebaseline: function(failures)
     {
-        failureInfoList = base.flattenArray(failures.testNameList().map(model.unexpectedFailureInfoForTestName));
+        var failureInfoList = base.flattenArray(failures.testNameList().map(model.unexpectedFailureInfoForTestName));
         checkout.rebaseline(failureInfoList, function() {
             // FIXME: We should have a better dialog than this!
             alert('Rebaseline done! Please land with "webkit-patch land-cowboy".');

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/actions.js (94721 => 94722)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/actions.js	2011-09-07 22:54:48 UTC (rev 94721)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/actions.js	2011-09-07 23:08:18 UTC (rev 94722)
@@ -32,9 +32,11 @@
     init: function() {
         this._eventName = null;
         $(this).addClass('action');
-        this.addEventListener('click', function() {
-            if (this._eventName)
+        this.addEventListener('click', function(event) {
+            if (this._eventName) {
                 $(this).trigger(this._eventName);
+                event.stopPropagation();
+            }
         }.bind(this));
     },
     makeDefault: function() {

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js (94721 => 94722)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js	2011-09-07 22:54:48 UTC (rev 94721)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js	2011-09-07 23:08:18 UTC (rev 94722)
@@ -155,7 +155,6 @@
             resultsGrid.addResults(resultsURLs);
             $(this).empty().append(
                 new ui.actions.List([
-                    new ui.actions.Rebaseline().makeDefault(),
                     new ui.actions.Previous(),
                     new ui.actions.Next()
                 ])).append(resultsGrid);
@@ -173,7 +172,12 @@
         Object.keys(resultsByTest).forEach(function (testName) {
             var link = document.createElement('a');
             $(link).attr('href', '#').text(testName);
-            this.appendChild(document.createElement('h3')).appendChild(link);
+
+            var header = document.createElement('h3');
+            $(header).append(new ui.actions.List([
+                new ui.actions.Rebaseline().makeDefault()
+            ])).append(link);
+            this.appendChild(header);
             this.appendChild(this._delegate.contentForTest(testName));
             ++this._length; // There doesn't seem to be any good way to get this information from accordion.
         }, this);
@@ -224,6 +228,11 @@
     {
         $(this).accordion('option', 'active', 0);
         $('.builder-selector', this)[0].firstResult();
+    },
+    currentTestName: function()
+    {
+        var currentIndex = $(this).accordion('option', 'active');
+        return $('h3 a', this)[currentIndex].textContent;
     }
 });
 
@@ -329,6 +338,10 @@
     firstResult: function()
     {
         this._testSelector.firstResult()
+    },
+    currentTestName: function()
+    {
+        return this._testSelector.currentTestName()
     }
 });
 

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results_unittests.js (94721 => 94722)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results_unittests.js	2011-09-07 22:54:48 UTC (rev 94721)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results_unittests.js	2011-09-07 23:08:18 UTC (rev 94722)
@@ -46,7 +46,7 @@
     }
 }
 
-test('View', 6, function() {
+test('View', 8, function() {
     var delegate = {
         fetchResultsURLs: function(failureInfo, callback) { return;}
     };
@@ -58,9 +58,11 @@
     view.nextResult();
     equals($('.test-selector', view).accordion('option', 'active'), 0);
     equals($($('.builder-selector', view)[0]).tabs('option', 'selected'), 1);
+    equals(view.currentTestName(), 'scrollbars/custom-scrollbar-with-incomplete-style.html');
     view.nextResult();
     equals($('.test-selector', view).accordion('option', 'active'), 1);
     equals($($('.builder-selector', view)[1]).tabs('option', 'selected'), 0);
+    equals(view.currentTestName(), 'userscripts/another-test.html');
     view.previousResult();
     equals($('.test-selector', view).accordion('option', 'active'), 0);
     equals($($('.builder-selector', view)[0]).tabs('option', 'selected'), 1);

Modified: trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css (94721 => 94722)


--- trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css	2011-09-07 22:54:48 UTC (rev 94721)
+++ trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css	2011-09-07 23:08:18 UTC (rev 94722)
@@ -35,6 +35,18 @@
     display: inline-block;
 }
 
+.results-view h3 ul.actions {
+    padding: 2px 0px;
+}
+
+.results-view h3 ul.actions {
+    visibility: hidden;
+}
+
+.results-view h3.ui-state-active ul.actions {
+    visibility: visible;
+}
+
 .ui-tabs .ui-tabs-panel.results-detail {
     padding: 0px;
 }

Modified: trunk/Tools/ChangeLog (94721 => 94722)


--- trunk/Tools/ChangeLog	2011-09-07 22:54:48 UTC (rev 94721)
+++ trunk/Tools/ChangeLog	2011-09-07 23:08:18 UTC (rev 94722)
@@ -1,3 +1,20 @@
+2011-09-07  Adam Barth  <[email protected]>
+
+        rebaseline button in garden-o-matic details view should work
+        https://bugs.webkit.org/show_bug.cgi?id=67738
+
+        Reviewed by Dimitri Glazkov.
+
+        This patch wires up the rebaseline button in garden-o-matic results
+        details view.  The button is current per-test, so there isn't a way to
+        rebaseline individual bots.  This is a place to start.  If we decide we
+        want per-bot rebaselining, we'll need to think of some better UI.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers.js:
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/actions.js:
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js:
+        * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css:
+
 2011-09-07  Eric Seidel  <[email protected]>
 
         Teach the PortFactory object how to pass along executive/user/filesystem to port objects (which fixes the failing rebaseline_test on bots)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to