WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
make js tests work, update w/ review feedback
bug-86242-20120511154445.patch (text/plain), 16.50 KB, created by
Dirk Pranke
on 2012-05-11 15:44:47 PDT
(
hide
)
Description:
make js tests work, update w/ review feedback
Filename:
MIME Type:
Creator:
Dirk Pranke
Created:
2012-05-11 15:44:47 PDT
Size:
16.50 KB
patch
obsolete
>Subversion Revision: 116787 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 53151991895bf3d8fb84c33047ff98de2bee1aef..ec7b79d4e3f5de44cedfd88102399b4880c6d2c7 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,5 +1,42 @@ > 2012-05-11 Dirk Pranke <dpranke@chromium.org> > >+ garden-o-matic should specify which types of baselines to rebaseline >+ https://bugs.webkit.org/show_bug.cgi?id=86242 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This change modifies garden-o-matic so that we are explicit >+ about whether to rebaseline the text file, the image file, or >+ both. This should prevent us from pulling incorrect or >+ unexpected baselines off the bots. >+ >+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout.js: >+ (.): >+ * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js: >+ (.): >+ * Scripts/webkitpy/tool/commands/rebaseline.py: >+ (AbstractRebaseliningCommand): >+ (AbstractRebaseliningCommand.__init__): >+ (RebaselineTest): >+ (RebaselineTest._rebaseline_test_and_update_expectations): >+ (RebaselineTest.execute): >+ (OptimizeBaselines): >+ (OptimizeBaselines._optimize_baseline): >+ (OptimizeBaselines.execute): >+ (AnalyzeBaselines): >+ (AnalyzeBaselines._analyze_baseline): >+ (AnalyzeBaselines.execute): >+ (RebaselineExpectations._rebaseline_port): >+ * Scripts/webkitpy/tool/servers/gardeningserver.py: >+ (GardeningHTTPRequestHandler.rebaseline): >+ (GardeningHTTPRequestHandler.optimizebaselines): >+ * Scripts/webkitpy/tool/servers/gardeningserver_unittest.py: >+ (GardeningServerTest.test_rebaseline): >+ (GardeningServerTest.test_rebaseline_new_port): >+ (GardeningServerTest.test_optimizebaselines): >+ >+2012-05-11 Dirk Pranke <dpranke@chromium.org> >+ > webkit-patch rebaseline should fetch stale expectations :) > https://bugs.webkit.org/show_bug.cgi?id=86231 > >diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout.js >index 8e1bc5d4f7c960187a0987f5b86844fe3b0f8dae..becc93e93ebd03030341439bfa2754392e5e6598 100644 >--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout.js >+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout.js >@@ -75,11 +75,12 @@ checkout.updateExpectations = function(failureInfoList, callback, checkoutUnavai > }, checkoutUnavailable); > }; > >-checkout.optimizeBaselines = function(testName, callback, checkoutUnavailable) >+checkout.optimizeBaselines = function(testName, suffixes, callback, checkoutUnavailable) > { > callIfCheckoutAvailable(function() { > net.post(config.kLocalServerURL + '/optimizebaselines?' + $.param({ > 'test': testName, >+ 'suffixes': suffixes, > }), function() { > callback(); > }); >@@ -102,9 +103,12 @@ checkout.rebaseline = function(failureInfoList, callback, progressCallback, chec > { > callIfCheckoutAvailable(function() { > base.callInSequence(function(failureInfo, callback) { >+ var suffixes = base.uniquifyArray(base.flattenArray(failureInfo.failureInfoList.map(results.failureTypeToExtensionList))).join(','); >+ > net.post(config.kLocalServerURL + '/rebaseline?' + $.param({ > 'builder': failureInfo.builderName, > 'test': failureInfo.testName, >+ 'suffixes': suffixes, > }), function() { > if (progressCallback) > progressCallback(failureInfo); >@@ -112,7 +116,11 @@ checkout.rebaseline = function(failureInfoList, callback, progressCallback, chec > }); > }, failureInfoList, function() { > var testNameList = base.uniquifyArray(failureInfoList.map(function(failureInfo) { return failureInfo.testName; })); >- base.callInSequence(checkout.optimizeBaselines, testNameList, callback); >+ var suffixes = base.uniquifyArray(base.flattenArray( >+ failureInfoList.map(function(failureInfo) { >+ return base.flattenArray(failureInfo.failureInfoList.map(results.failureTypeToExtensionList)) >+ }))).join(','); >+ base.callInSequence(function(testName, callback) { checkout.optimizeBaselines(testName, suffixes, callback)}, testNameList, callback); > }); > }, checkoutUnavailable); > }; >diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js >index 4d38bd2e2f310bb30dcc13129e0fcb6e0f1a410e..bd66d9af77272c0432f9e408e487c84d24201352 100644 >--- a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js >+++ b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/checkout_unittests.js >@@ -60,12 +60,12 @@ test("optimizeBaselines", 3, function() { > var simulator = new NetworkSimulator(); > simulator.post = function(url, callback) > { >- equals(url, 'http://127.0.0.1:8127/optimizebaselines?test=another%2Ftest.svg'); >+ equals(url, 'http://127.0.0.1:8127/optimizebaselines?test=another%2Ftest.svg&suffixes=txt%2Cpng'); > simulator.scheduleCallback(callback); > }; > > simulator.runTest(function() { >- checkout.optimizeBaselines('another/test.svg', function() { >+ checkout.optimizeBaselines('another/test.svg', 'txt,png', function() { > ok(true); > }); > }); >@@ -97,12 +97,15 @@ test("rebaseline", 6, function() { > checkout.rebaseline([{ > 'builderName': 'WebKit Linux', > 'testName': 'another/test.svg', >+ 'failureInfoList': ['IMAGE'], > }, { > 'builderName': 'WebKit Mac10.6', > 'testName': 'another/test.svg', >+ 'failureInfoList': ['IMAGE', 'TEXT', 'IMAGE+TEXT'], > }, { > 'builderName': 'Webkit Vista', > 'testName': 'fast/test.html', >+ 'failureInfoList': ['IMAGE+TEXT'], > }], function() { > ok(true); > }, function(failureInfo) { >@@ -113,11 +116,11 @@ test("rebaseline", 6, function() { > }); > > deepEqual(requestedURLs, [ >- "http://127.0.0.1:8127/rebaseline?builder=WebKit+Linux&test=another%2Ftest.svg", >- "http://127.0.0.1:8127/rebaseline?builder=WebKit+Mac10.6&test=another%2Ftest.svg", >- "http://127.0.0.1:8127/rebaseline?builder=Webkit+Vista&test=fast%2Ftest.html", >- "http://127.0.0.1:8127/optimizebaselines?test=another%2Ftest.svg", >- "http://127.0.0.1:8127/optimizebaselines?test=fast%2Ftest.html" >+ "http://127.0.0.1:8127/rebaseline?builder=WebKit+Linux&test=another%2Ftest.svg&suffixes=png", >+ "http://127.0.0.1:8127/rebaseline?builder=WebKit+Mac10.6&test=another%2Ftest.svg&suffixes=png%2Ctxt", >+ "http://127.0.0.1:8127/rebaseline?builder=Webkit+Vista&test=fast%2Ftest.html&suffixes=txt%2Cpng", >+ "http://127.0.0.1:8127/optimizebaselines?test=another%2Ftest.svg&suffixes=png%2Ctxt", >+ "http://127.0.0.1:8127/optimizebaselines?test=fast%2Ftest.html&suffixes=png%2Ctxt" > ]); > }); > >diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py >index 83aa6a640994641814c4c496de024dac34bd6522..b375e8e05d9d7ebbf851cca77fff0f8560f52392 100644 >--- a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py >+++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py >@@ -47,6 +47,7 @@ from webkitpy.tool.grammar import pluralize > from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand > > >+# FIXME: Pull this from Port.baseline_extensions(). > _baseline_suffix_list = ['png', 'wav', 'txt'] > > >@@ -55,7 +56,16 @@ def _baseline_name(fs, test_name, suffix): > return fs.splitext(test_name)[0] + TestResultWriter.FILENAME_SUFFIX_EXPECTED + "." + suffix > > >-class RebaselineTest(AbstractDeclarativeCommand): >+class AbstractRebaseliningCommand(AbstractDeclarativeCommand): >+ def __init__(self): >+ options = [ >+ optparse.make_option('--suffixes', default=','.join(_baseline_suffix_list), action='store', >+ help='file types to rebaseline')] >+ AbstractDeclarativeCommand.__init__(self, options=options) >+ self._baseline_suffix_list = _baseline_suffix_list >+ >+ >+class RebaselineTest(AbstractRebaseliningCommand): > name = "rebaseline-test" > help_text = "Rebaseline a single test from a buildbot. (Currently works only with build.chromium.org buildbots.)" > argument_names = "BUILDER_NAME TEST_NAME [PLATFORMS_TO_MOVE_EXISTING_BASELINES_TO]" >@@ -143,11 +153,13 @@ class RebaselineTest(AbstractDeclarativeCommand): > self._save_baseline(self._tool.web.get_binary(source_baseline, convert_404_to_None=True), target_baseline) > > def _rebaseline_test_and_update_expectations(self, builder_name, test_name, platforms_to_move_existing_baselines_to): >- for suffix in _baseline_suffix_list: >+ for suffix in self._baseline_suffix_list: > self._rebaseline_test(builder_name, test_name, platforms_to_move_existing_baselines_to, suffix) > self._update_expectations_file(builder_name, test_name) > > def execute(self, options, args, tool): >+ self._baseline_suffix_list = options.suffixes.split(',') >+ > if len(args) > 2: > platforms_to_move_existing_baselines_to = args[2:] > else: >@@ -155,18 +167,19 @@ class RebaselineTest(AbstractDeclarativeCommand): > self._rebaseline_test_and_update_expectations(args[0], args[1], platforms_to_move_existing_baselines_to) > > >-class OptimizeBaselines(AbstractDeclarativeCommand): >+class OptimizeBaselines(AbstractRebaseliningCommand): > name = "optimize-baselines" > help_text = "Reshuffles the baselines for the given tests to use as litte space on disk as possible." > argument_names = "TEST_NAMES" > > def _optimize_baseline(self, test_name): >- for suffix in _baseline_suffix_list: >+ for suffix in self._baseline_suffix_list: > baseline_name = _baseline_name(self._tool.filesystem, test_name, suffix) > if not self._baseline_optimizer.optimize(baseline_name): > print "Hueristics failed to optimize %s" % baseline_name > > def execute(self, options, args, tool): >+ self._baseline_suffix_list = options.suffixes.split(',') > self._baseline_optimizer = BaselineOptimizer(tool) > self._port = tool.port_factory.get("chromium-win-win7") # FIXME: This should be selectable. > >@@ -175,7 +188,7 @@ class OptimizeBaselines(AbstractDeclarativeCommand): > self._optimize_baseline(test_name) > > >-class AnalyzeBaselines(AbstractDeclarativeCommand): >+class AnalyzeBaselines(AbstractRebaseliningCommand): > name = "analyze-baselines" > help_text = "Analyzes the baselines for the given tests and prints results that are identical." > argument_names = "TEST_NAMES" >@@ -188,12 +201,13 @@ class AnalyzeBaselines(AbstractDeclarativeCommand): > print ' '.join(results_names) > > def _analyze_baseline(self, test_name): >- for suffix in _baseline_suffix_list: >+ for suffix in self._baseline_suffix_list: > baseline_name = _baseline_name(self._tool.filesystem, test_name, suffix) > directories_by_result = self._baseline_optimizer.directories_by_result(baseline_name) > self._print(baseline_name, directories_by_result) > > def execute(self, options, args, tool): >+ self._baseline_suffix_list = options.suffixes.split(',') > self._baseline_optimizer = BaselineOptimizer(tool) > self._port = tool.port_factory.get("chromium-win-win7") # FIXME: This should be selectable. > >@@ -248,6 +262,7 @@ class RebaselineExpectations(AbstractDeclarativeCommand): > for test_name in self._tests_to_rebaseline(self._tool.port_factory.get(port_name)): > self._touched_test_names.add(test_name) > print " %s" % test_name >+ # FIXME: need to extract the correct list of suffixes here. > self._run_webkit_patch(['rebaseline-test', builder_name, test_name]) > > def execute(self, options, args, tool): >diff --git a/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py b/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py >index 3d09b5f7697b96337f55e071bb252ed0dabdb1bb..f4340289742e061c843c5bdce02b964baeab6a3d 100644 >--- a/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py >+++ b/Tools/Scripts/webkitpy/tool/servers/gardeningserver.py >@@ -139,8 +139,10 @@ class GardeningHTTPRequestHandler(ReflectionHandler): > builder = self.query['builder'][0] > command = [ > 'rebaseline-test', >+ '--suffixes', self.query['suffixes'][0], > builder, > self.query['test'][0], >+ > ] > command.extend(builders.fallback_port_names_for_new_port(builder)) > self._run_webkit_patch(command) >@@ -150,6 +152,7 @@ class GardeningHTTPRequestHandler(ReflectionHandler): > test = self.query['test'][0] > self._run_webkit_patch([ > 'optimize-baselines', >+ '--suffixes', self.query['suffixes'][0], > test, > ]) > self._serve_text('success') >diff --git a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py >index 13e9001b7725945522e6a9fbf12b919474097bdc..c96b660343c660048d3d14dcb4c975ac8afac2f2 100644 >--- a/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py >+++ b/Tools/Scripts/webkitpy/tool/servers/gardeningserver_unittest.py >@@ -183,20 +183,20 @@ class GardeningServerTest(unittest.TestCase): > > def test_rebaseline(self): > builders._exact_matches = {"MOCK builder": {"port_name": "mock-port-name", "specifiers": set(["mock-specifier"])}} >- expected_stderr = "MOCK run_command: ['echo', 'rebaseline-test', 'MOCK builder', 'user-scripts/another-test.html'], cwd=/mock-checkout\n" >+ expected_stderr = "MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt,png', 'MOCK builder', 'user-scripts/another-test.html'], cwd=/mock-checkout\n" > expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n" >- self._post_to_path("/rebaseline?builder=MOCK+builder&test=user-scripts/another-test.html", expected_stderr=expected_stderr, expected_stdout=expected_stdout) >+ self._post_to_path("/rebaseline?builder=MOCK+builder&test=user-scripts/another-test.html&suffixes=txt,png", expected_stderr=expected_stderr, expected_stdout=expected_stdout) > > def test_rebaseline_new_port(self): > builders._exact_matches = {"MOCK builder": {"port_name": "mock-port-name", "specifiers": set(["mock-specifier"]), "move_overwritten_baselines_to": ["mock-port-fallback", "mock-port-fallback2"]}} >- expected_stderr = "MOCK run_command: ['echo', 'rebaseline-test', 'MOCK builder', 'user-scripts/another-test.html', 'mock-port-fallback', 'mock-port-fallback2'], cwd=/mock-checkout\n" >+ expected_stderr = "MOCK run_command: ['echo', 'rebaseline-test', '--suffixes', 'txt,png', 'MOCK builder', 'user-scripts/another-test.html', 'mock-port-fallback', 'mock-port-fallback2'], cwd=/mock-checkout\n" > expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n" >- self._post_to_path("/rebaseline?builder=MOCK+builder&test=user-scripts/another-test.html", expected_stderr=expected_stderr, expected_stdout=expected_stdout) >+ self._post_to_path("/rebaseline?builder=MOCK+builder&test=user-scripts/another-test.html&suffixes=txt,png", expected_stderr=expected_stderr, expected_stdout=expected_stdout) > > def test_optimizebaselines(self): >- expected_stderr = "MOCK run_command: ['echo', 'optimize-baselines', 'user-scripts/another-test.html'], cwd=/mock-checkout\n" >+ expected_stderr = "MOCK run_command: ['echo', 'optimize-baselines', '--suffixes', 'txt,png', 'user-scripts/another-test.html'], cwd=/mock-checkout\n" > expected_stdout = "== Begin Response ==\nsuccess\n== End Response ==\n" >- self._post_to_path("/optimizebaselines?test=user-scripts/another-test.html", expected_stderr=expected_stderr, expected_stdout=expected_stdout) >+ self._post_to_path("/optimizebaselines?test=user-scripts/another-test.html&suffixes=txt,png", expected_stderr=expected_stderr, expected_stdout=expected_stdout) > > def test_updateexpectations(self): > expected_stderr = ""
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
abarth
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 86242
:
141474
| 141515