[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:10 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 1c7e9d5469aba5b2479760c451b2d7fdd189aaf8
Author: mihaip at chromium.org <mihaip at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 3 18:35:37 2010 +0000
2010-12-02 Mihai Parparita <mihaip at chromium.org>
Reviewed by Tony Chang.
Rebaseline server: move existing baselines
https://bugs.webkit.org/show_bug.cgi?id=50421
Implement moving of existing baselines: move all files that are about
to be overwriten by update baselines.
Also fix a typo in the UI JS.
* Scripts/webkitpy/tool/commands/data/rebaselineserver/queue.js:
* Scripts/webkitpy/tool/commands/rebaselineserver.py:
* Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index cf94f76..8eb2c23 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,19 @@
+2010-12-02 Mihai Parparita <mihaip at chromium.org>
+
+ Reviewed by Tony Chang.
+
+ Rebaseline server: move existing baselines
+ https://bugs.webkit.org/show_bug.cgi?id=50421
+
+ Implement moving of existing baselines: move all files that are about
+ to be overwriten by update baselines.
+
+ Also fix a typo in the UI JS.
+
+ * Scripts/webkitpy/tool/commands/data/rebaselineserver/queue.js:
+ * Scripts/webkitpy/tool/commands/rebaselineserver.py:
+ * Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py:
+
2010-12-03 Sheriff Bot <webkit.review.bot at gmail.com>
Unreviewed, rolling out r73211.
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/queue.js b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/queue.js
index 4c094fc..8685086 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/queue.js
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/queue.js
@@ -39,7 +39,7 @@ function RebaselineQueue()
var self = this;
$('add-to-rebaseline-queue').addEventListener(
- 'click', function() { self.addCurentTest(); });
+ 'click', function() { self.addCurrentTest(); });
this._selectNode.addEventListener('change', updateState);
this._removeSelectionButtonNode.addEventListener(
'click', function() { self._removeSelection(); });
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py b/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py
index d0db9bc..e08c8b2 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py
@@ -260,10 +260,37 @@ def _rebaseline_test(test_file, baseline_target, baseline_move_to, test_config,
if baseline_target in current_baselines and baseline_move_to != 'none':
log(' Moving current %s baselines to %s' %
(baseline_target, baseline_move_to))
- log(' FIXME: Add support for moving existing baselines')
- return False
+
+ # See which ones we need to move (only those that are about to be
+ # updated), and make sure we're not clobbering any files in the
+ # destination.
+ current_extensions = set(current_baselines[baseline_target].keys())
+ actual_result_extensions = [
+ os.path.splitext(f)[1] for f in actual_result_files]
+ extensions_to_move = current_extensions.intersection(
+ actual_result_extensions)
+
+ if extensions_to_move.intersection(
+ current_baselines.get(baseline_move_to, {}).keys()):
+ log(' Already had baselines in %s, could not move existing '
+ '%s ones' % (baseline_move_to, baseline_target))
+ return False
+
+ # Do the actual move.
+ if extensions_to_move:
+ if not _move_test_baselines(
+ test_file,
+ list(extensions_to_move),
+ baseline_target,
+ baseline_move_to,
+ test_config,
+ log):
+ return False
+ else:
+ log(' No current baselines to move')
log(' Updating baselines for %s' % baseline_target)
+ filesystem.maybe_make_directory(target_expectations_directory)
for source_file in actual_result_files:
source_path = filesystem.join(test_results_directory, source_file)
destination_file = source_file.replace('-actual', '-expected')
@@ -281,6 +308,41 @@ def _rebaseline_test(test_file, baseline_target, baseline_move_to, test_config,
return True
+def _move_test_baselines(test_file, extensions_to_move, source_platform, destination_platform, test_config, log):
+ test_file_name = os.path.splitext(os.path.basename(test_file))[0]
+ test_directory = os.path.dirname(test_file)
+ filesystem = test_config.filesystem
+
+ # Want predictable output order for unit tests.
+ extensions_to_move.sort()
+
+ source_directory = os.path.join(
+ test_config.layout_tests_directory,
+ 'platform',
+ source_platform,
+ test_directory)
+ destination_directory = os.path.join(
+ test_config.layout_tests_directory,
+ 'platform',
+ destination_platform,
+ test_directory)
+ filesystem.maybe_make_directory(destination_directory)
+
+ for extension in extensions_to_move:
+ file_name = test_file_name + '-expected' + extension
+ source_path = filesystem.join(source_directory, file_name)
+ destination_path = filesystem.join(destination_directory, file_name)
+ filesystem.copyfile(source_path, destination_path)
+ exit_code = test_config.scm.add(destination_path, return_exit_code=True)
+ if exit_code:
+ log(' Could not update %s in SCM, exit code %d' %
+ (file_name, exit_code))
+ return False
+ else:
+ log(' Moved %s' % file_name)
+
+ return True
+
def _get_test_baselines(test_file, test_config):
class AllPlatformsPort(WebKitPort):
def __init__(self):
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py
index 5cfb629..f4371f4 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py
@@ -36,7 +36,7 @@ from webkitpy.tool.mocktool import MockSCM
class RebaselineTestTest(unittest.TestCase):
- def test_text_rebaseline(self):
+ def test_text_rebaseline_update(self):
self._assertRebaseline(
test_files=(
'fast/text-expected.txt',
@@ -55,7 +55,25 @@ class RebaselineTestTest(unittest.TestCase):
' Updated text-expected.txt',
])
- def test_text_rebaseline_move_no_op(self):
+ def test_text_rebaseline_new(self):
+ self._assertRebaseline(
+ test_files=(
+ 'fast/text-expected.txt',
+ ),
+ results_files=(
+ 'fast/text-actual.txt',
+ ),
+ test_name='fast/text.html',
+ baseline_target='mac',
+ baseline_move_to='none',
+ expected_success=True,
+ expected_log=[
+ 'Rebaselining fast/text...',
+ ' Updating baselines for mac',
+ ' Updated text-expected.txt',
+ ])
+
+ def test_text_rebaseline_move_no_op_1(self):
self._assertRebaseline(
test_files=(
'fast/text-expected.txt',
@@ -74,6 +92,27 @@ class RebaselineTestTest(unittest.TestCase):
' Updated text-expected.txt',
])
+ def test_text_rebaseline_move_no_op_2(self):
+ self._assertRebaseline(
+ test_files=(
+ 'fast/text-expected.txt',
+ 'platform/mac/fast/text-expected.checksum',
+ ),
+ results_files=(
+ 'fast/text-actual.txt',
+ ),
+ test_name='fast/text.html',
+ baseline_target='mac',
+ baseline_move_to='mac-leopard',
+ expected_success=True,
+ expected_log=[
+ 'Rebaselining fast/text...',
+ ' Moving current mac baselines to mac-leopard',
+ ' No current baselines to move',
+ ' Updating baselines for mac',
+ ' Updated text-expected.txt',
+ ])
+
def test_text_rebaseline_move(self):
self._assertRebaseline(
test_files=(
@@ -86,11 +125,59 @@ class RebaselineTestTest(unittest.TestCase):
test_name='fast/text.html',
baseline_target='mac',
baseline_move_to='mac-leopard',
+ expected_success=True,
+ expected_log=[
+ 'Rebaselining fast/text...',
+ ' Moving current mac baselines to mac-leopard',
+ ' Moved text-expected.txt',
+ ' Updating baselines for mac',
+ ' Updated text-expected.txt',
+ ])
+
+ def test_text_rebaseline_move_only_images(self):
+ self._assertRebaseline(
+ test_files=(
+ 'fast/image-expected.txt',
+ 'platform/mac/fast/image-expected.txt',
+ 'platform/mac/fast/image-expected.png',
+ 'platform/mac/fast/image-expected.checksum',
+ ),
+ results_files=(
+ 'fast/image-actual.png',
+ 'fast/image-actual.checksum',
+ ),
+ test_name='fast/image.html',
+ baseline_target='mac',
+ baseline_move_to='mac-leopard',
+ expected_success=True,
+ expected_log=[
+ 'Rebaselining fast/image...',
+ ' Moving current mac baselines to mac-leopard',
+ ' Moved image-expected.checksum',
+ ' Moved image-expected.png',
+ ' Updating baselines for mac',
+ ' Updated image-expected.checksum',
+ ' Updated image-expected.png',
+ ])
+
+ def test_text_rebaseline_move_already_exist(self):
+ self._assertRebaseline(
+ test_files=(
+ 'fast/text-expected.txt',
+ 'platform/mac-leopard/fast/text-expected.txt',
+ 'platform/mac/fast/text-expected.txt',
+ ),
+ results_files=(
+ 'fast/text-actual.txt',
+ ),
+ test_name='fast/text.html',
+ baseline_target='mac',
+ baseline_move_to='mac-leopard',
expected_success=False,
expected_log=[
'Rebaselining fast/text...',
' Moving current mac baselines to mac-leopard',
- ' FIXME: Add support for moving existing baselines',
+ ' Already had baselines in mac-leopard, could not move existing mac ones',
])
def test_image_rebaseline(self):
@@ -212,6 +299,6 @@ def get_test_config(test_files=[], result_files=[]):
TestMacPort(),
layout_tests_directory,
results_directory,
- ('mac', 'win', 'linux'),
+ ('mac', 'mac-leopard', 'win', 'linux'),
mock_filesystem,
MockSCM())
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list