[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

mihaip at chromium.org mihaip at chromium.org
Wed Dec 22 17:58:55 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit bad4cc475254fd7c6ee25a2125f0a41eb73747f5
Author: mihaip at chromium.org <mihaip at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 3 22:02:42 2010 +0000

    2010-12-03  Mihai Parparita  <mihaip at chromium.org>
    
            Reviewed by Tony Chang.
    
            Rebaseline server: organize tests by state, add dry run mode
            https://bugs.webkit.org/show_bug.cgi?id=50473
    
            Group tests in the menu by state, so that it's easier to see after
            processing the queue which failed.
    
            Add support for the --dry-run flag so that it's easier to test changes
            such as this (stubs out filesystem and SCM operations).
    
            * Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js:
            * Scripts/webkitpy/tool/commands/data/rebaselineserver/queue.js:
            * Scripts/webkitpy/tool/commands/rebaselineserver.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73298 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index df70476..afd2d95 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,20 @@
+2010-12-03  Mihai Parparita  <mihaip at chromium.org>
+
+        Reviewed by Tony Chang.
+
+        Rebaseline server: organize tests by state, add dry run mode
+        https://bugs.webkit.org/show_bug.cgi?id=50473
+        
+        Group tests in the menu by state, so that it's easier to see after
+        processing the queue which failed.
+        
+        Add support for the --dry-run flag so that it's easier to test changes
+        such as this (stubs out filesystem and SCM operations).
+
+        * Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js:
+        * Scripts/webkitpy/tool/commands/data/rebaselineserver/queue.js:
+        * Scripts/webkitpy/tool/commands/rebaselineserver.py:
+
 2010-12-03  Brady Eidson  <beidson at apple.com>
 
         Reviewed by Anders Carlsson.
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js
index 66990d0..92f7b7d 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js
@@ -204,25 +204,59 @@ function selectFailureType()
  */
 function selectDirectory()
 {
+    var previouslySelectedTest = getSelectedTest();
+
     var selectedDirectory = getSelectValue('directory-selector');
     selectedTests = testsByDirectory[selectedDirectory];
-
     selectedTests.sort();
 
-    var testSelector = $('test-selector');
-    testSelector.innerHTML = '';
-
+    var testsByState = {};
     selectedTests.forEach(function(testName) {
-        var testOption = document.createElement('option');
-        testOption.value = testName;
-        var testDisplayName = testName;
-        if (testName.lastIndexOf(selectedDirectory) == 0) {
-            testDisplayName = testName.substring(selectedDirectory.length);
+        var state = results.tests[testName].state;
+        if (state == STATE_IN_QUEUE) {
+            state = STATE_NEEDS_REBASELINE;
         }
-        testOption.innerHTML = '&nbsp;&nbsp;' + testDisplayName;
-        testSelector.appendChild(testOption);
+        if (!(state in testsByState)) {
+            testsByState[state] = [];
+        }
+        testsByState[state].push(testName);
     });
 
+    var optionIndexByTest = {};
+
+    var testSelector = $('test-selector');
+    testSelector.innerHTML = '';
+
+    for (var state in testsByState) {
+        var stateOption = document.createElement('option');
+        stateOption.textContent = STATE_TO_DISPLAY_STATE[state];
+        stateOption.disabled = true;
+        testSelector.appendChild(stateOption);
+
+        testsByState[state].forEach(function(testName) {
+            var testOption = document.createElement('option');
+            testOption.value = testName;
+            var testDisplayName = testName;
+            if (testName.lastIndexOf(selectedDirectory) == 0) {
+                testDisplayName = testName.substring(selectedDirectory.length);
+            }
+            testOption.innerHTML = '&nbsp;&nbsp;' + testDisplayName;
+            optionIndexByTest[testName] = testSelector.options.length;
+            testSelector.appendChild(testOption);
+        });
+    }
+
+    if (previouslySelectedTest in optionIndexByTest) {
+        testSelector.selectedIndex = optionIndexByTest[previouslySelectedTest];
+    } else if (STATE_NEEDS_REBASELINE in testsByState) {
+        testSelector.selectedIndex =
+            optionIndexByTest[testsByState[STATE_NEEDS_REBASELINE][0]];
+        selectTest();
+    } else {
+        testSelector.selectedIndex = 1;
+        selectTest();
+    }
+
     selectTest();
 }
 
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/queue.js b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/queue.js
index 8685086..338e28f 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/queue.js
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/queue.js
@@ -159,6 +159,11 @@ RebaselineQueue.prototype._rebaselineTest = function(testName)
         self._inProgressRebaselineCount--;
         results.tests[testName].state = newState;
         updateState();
+        // If we're done with a set of rebaselines, regenerate the test menu
+        // (which is grouped by state) since test states have changed.
+        if (self._inProgressRebaselineCount == 0) {
+            selectDirectory();
+        }
     }
 
     function handleSuccess() {
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py b/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py
index e08c8b2..ad51f2d 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py
@@ -382,6 +382,7 @@ def _get_test_baselines(test_file, test_config):
 
     return all_test_baselines
 
+
 class RebaselineServer(AbstractDeclarativeCommand):
     name = "rebaseline-server"
     help_text = __doc__
@@ -396,6 +397,19 @@ class RebaselineServer(AbstractDeclarativeCommand):
     def execute(self, options, args, tool):
         results_directory = args[0]
         filesystem = system.filesystem.FileSystem()
+        scm = self._tool.scm()
+
+        if options.dry_run:
+
+            def no_op_copyfile(src, dest):
+                pass
+
+            def no_op_add(path, return_exit_code=False):
+                if return_exit_code:
+                    return 0
+
+            filesystem.copyfile = no_op_copyfile
+            scm.add = no_op_add
 
         print 'Parsing unexpected_results.json...'
         results_json_path = filesystem.join(
@@ -414,7 +428,7 @@ class RebaselineServer(AbstractDeclarativeCommand):
             results_directory,
             platforms,
             filesystem,
-            self._tool.scm())
+            scm)
 
         print 'Gathering current baselines...'
         for test_file, test_json in results_json['tests'].items():

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list