Diff
Modified: trunk/Tools/ChangeLog (89847 => 89848)
--- trunk/Tools/ChangeLog 2011-06-27 20:18:54 UTC (rev 89847)
+++ trunk/Tools/ChangeLog 2011-06-27 20:53:01 UTC (rev 89848)
@@ -1,3 +1,26 @@
+2011-06-27 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r89834.
+ http://trac.webkit.org/changeset/89834
+ https://bugs.webkit.org/show_bug.cgi?id=63476
+
+ Broke test-webkitpy (Requested by abarth on #webkit).
+
+ * Scripts/webkitpy/common/net/layouttestresults.py:
+ * Scripts/webkitpy/common/system/outputcapture.py:
+ * Scripts/webkitpy/layout_tests/layout_package/manager.py:
+ * Scripts/webkitpy/layout_tests/layout_package/single_test_runner.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/config.py:
+ * Scripts/webkitpy/layout_tests/port/config_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/port/webkit_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+ * Scripts/webkitpy/tool/commands/commandtest.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
2011-06-27 Jeff Miller <[email protected]>
Reviewed by Adam Roben.
Modified: trunk/Tools/Scripts/webkitpy/common/net/layouttestresults.py (89847 => 89848)
--- trunk/Tools/Scripts/webkitpy/common/net/layouttestresults.py 2011-06-27 20:18:54 UTC (rev 89847)
+++ trunk/Tools/Scripts/webkitpy/common/net/layouttestresults.py 2011-06-27 20:53:01 UTC (rev 89848)
@@ -48,7 +48,6 @@
stderr_key = u'Tests that had stderr output:'
fail_key = u'Tests where results did not match expected results:'
timeout_key = u'Tests that timed out:'
- # FIXME: This may need to be made aware of WebKitTestRunner results for WebKit2.
crash_key = u'Tests that caused the DumpRenderTree tool to crash:'
missing_key = u'Tests that had no expected results (probably new):'
webprocess_crash_key = u'Tests that caused the Web process to crash:'
Modified: trunk/Tools/Scripts/webkitpy/common/system/outputcapture.py (89847 => 89848)
--- trunk/Tools/Scripts/webkitpy/common/system/outputcapture.py 2011-06-27 20:18:54 UTC (rev 89847)
+++ trunk/Tools/Scripts/webkitpy/common/system/outputcapture.py 2011-06-27 20:53:01 UTC (rev 89848)
@@ -32,7 +32,6 @@
import unittest
from StringIO import StringIO
-
class OutputCapture(object):
def __init__(self):
self.saved_outputs = dict()
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/manager.py (89847 => 89848)
--- trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/manager.py 2011-06-27 20:18:54 UTC (rev 89847)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/manager.py 2011-06-27 20:53:01 UTC (rev 89848)
@@ -652,7 +652,7 @@
# FIXME: If we start workers up too quickly, DumpRenderTree appears
# to thrash on something and time out its first few tests. Until
# we can figure out what's going on, sleep a bit in between
- # workers. This needs a bug filed.
+ # workers.
time.sleep(0.1)
self._printer.print_update("Starting testing ...")
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/single_test_runner.py (89847 => 89848)
--- trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/single_test_runner.py 2011-06-27 20:18:54 UTC (rev 89847)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/single_test_runner.py 2011-06-27 20:53:01 UTC (rev 89848)
@@ -143,7 +143,7 @@
return TestResult(self._filename, failures, driver_output.test_time)
def _save_baselines(self, driver_output):
- # Although all DumpRenderTree output should be utf-8,
+ # Although all test_shell/DumpRenderTree output should be utf-8,
# we do not ever decode it inside run-webkit-tests. For some tests
# DumpRenderTree may not output utf-8 text (e.g. webarchives).
self._save_baseline_data(driver_output.text, ".txt",
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py (89847 => 89848)
--- trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py 2011-06-27 20:18:54 UTC (rev 89847)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py 2011-06-27 20:53:01 UTC (rev 89848)
@@ -104,12 +104,14 @@
return cPickle.dumps(self)
def should_kill_dump_render_tree(self):
- """Returns True if we should kill DumpRenderTree before the next test."""
+ """Returns True if we should kill DumpRenderTree before the next
+ test."""
return False
class FailureTimeout(TestFailure):
- """Test timed out. We also want to restart DumpRenderTree if this happens."""
+ """Test timed out. We also want to restart DumpRenderTree if this
+ happens."""
def __init__(self, is_reftest=False):
self.is_reftest = is_reftest
@@ -128,7 +130,6 @@
@staticmethod
def message():
- # FIXME: This is wrong for WebKit2 (which uses WebKitTestRunner).
return "DumpRenderTree crashed"
def should_kill_dump_render_tree(self):
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py (89847 => 89848)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2011-06-27 20:18:54 UTC (rev 89847)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2011-06-27 20:53:01 UTC (rev 89848)
@@ -589,6 +589,12 @@
WebKit source tree and the list of path components in |*comps|."""
return self._config.path_from_webkit_base(*comps)
+ def script_path(self, script_name):
+ return self._config.script_path(script_name)
+
+ def script_shell_command(self, script_name):
+ return self._config.script_shell_command(script_name)
+
def path_to_test_expectations_file(self):
"""Update the test expectations to the passed-in string.
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/config.py (89847 => 89848)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/config.py 2011-06-27 20:18:54 UTC (rev 89847)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/config.py 2011-06-27 20:53:01 UTC (rev 89848)
@@ -71,21 +71,32 @@
def build_directory(self, configuration):
"""Returns the path to the build directory for the configuration."""
if configuration:
- flags = ["--configuration", self.flag_for_configuration(configuration)]
+ flags = ["--configuration",
+ self._FLAGS_FROM_CONFIGURATIONS[configuration]]
else:
configuration = ""
flags = ["--top-level"]
if not self._build_directories.get(configuration):
- args = ["perl", self.script_path("webkit-build-directory")] + flags
+ args = ["perl", self._script_path("webkit-build-directory")] + flags
self._build_directories[configuration] = (
self._executive.run_command(args).rstrip())
return self._build_directories[configuration]
- def flag_for_configuration(self, configuration):
- return self._FLAGS_FROM_CONFIGURATIONS[configuration]
+ def build_dumprendertree(self, configuration):
+ """Builds DRT in the given configuration.
+ Returns True if the build was successful and up-to-date."""
+ flag = self._FLAGS_FROM_CONFIGURATIONS[configuration]
+ exit_code = self._executive.run_command([
+ self._script_path("build-dumprendertree"), flag],
+ return_exit_code=True)
+ if exit_code != 0:
+ _log.error("Failed to build DumpRenderTree")
+ return False
+ return True
+
def default_configuration(self):
"""Returns the default configuration for the user.
@@ -96,15 +107,15 @@
if not self._default_configuration:
self._default_configuration = 'Release'
if self._default_configuration not in self._FLAGS_FROM_CONFIGURATIONS:
- _log.warn("Configuration \"%s\" is not a recognized value.\n" % self._default_configuration)
- _log.warn("Scripts may fail. See 'set-webkit-configuration --help'.")
+ _log.warn("Configuration \"%s\" is not a recognized value.\n" %
+ self._default_configuration)
+ _log.warn("Scripts may fail. "
+ "See 'set-webkit-configuration --help'.")
return self._default_configuration
def path_from_webkit_base(self, *comps):
return self._filesystem.join(self.webkit_base_dir(), *comps)
- # FIXME: We should only have one implementation of this logic,
- # if scm.find_checkout_root() is broken for Chromium, we should fix (or at least wrap) it!
def webkit_base_dir(self):
"""Returns the absolute path to the top of the WebKit tree.
@@ -122,8 +133,9 @@
self._webkit_base_dir = abspath[0:abspath.find('Tools') - 1]
return self._webkit_base_dir
- def script_path(self, script_name):
- return self._filesystem.join(self.webkit_base_dir(), "Tools", "Scripts", script_name)
+ def _script_path(self, script_name):
+ return self._filesystem.join(self.webkit_base_dir(), "Tools",
+ "Scripts", script_name)
def _determine_configuration(self):
# This mirrors the logic in webkitdirs.pm:determineConfiguration().
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/config_unittest.py (89847 => 89848)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/config_unittest.py 2011-06-27 20:18:54 UTC (rev 89847)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/config_unittest.py 2011-06-27 20:53:01 UTC (rev 89848)
@@ -91,6 +91,29 @@
self.assertTrue(c.build_directory('Debug').endswith('/Debug'))
self.assertRaises(KeyError, c.build_directory, 'Unknown')
+ def test_build_dumprendertree__success(self):
+ c = self.make_config(exit_code=0)
+ self.assertTrue(c.build_dumprendertree("Debug"))
+ self.assertTrue(c.build_dumprendertree("Release"))
+ self.assertRaises(KeyError, c.build_dumprendertree, "Unknown")
+
+ def test_build_dumprendertree__failure(self):
+ c = self.make_config(exit_code=-1)
+
+ # FIXME: Build failures should log errors. However, the message we
+ # get depends on how we're being called; as a standalone test,
+ # we'll get the "no handlers found" message. As part of
+ # test-webkitpy, we get the actual message. Really, we need
+ # outputcapture to install its own handler.
+ oc = outputcapture.OutputCapture()
+ oc.capture_output()
+ self.assertFalse(c.build_dumprendertree('Debug'))
+ oc.restore_output()
+
+ oc.capture_output()
+ self.assertFalse(c.build_dumprendertree('Release'))
+ oc.restore_output()
+
def test_default_configuration__release(self):
self.assert_configuration('Release', 'Release')
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py (89847 => 89848)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py 2011-06-27 20:18:54 UTC (rev 89847)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py 2011-06-27 20:53:01 UTC (rev 89848)
@@ -41,10 +41,8 @@
import time
import webbrowser
-
from webkitpy.common.net.buildbot import BuildBot
from webkitpy.common.system import ospath
-from webkitpy.common.system.executive import ScriptError
from webkitpy.layout_tests.port import base, builders, server_process
_log = logging.getLogger("webkitpy.layout_tests.port.webkit")
@@ -60,11 +58,6 @@
# FIXME: disable pixel tests until they are run by default on the build machines.
self.set_option_default("pixel_tests", False)
- def driver_name(self):
- if self.get_option('webkit_test_runner'):
- return "WebKitTestRunner"
- return "DumpRenderTree"
-
def baseline_search_path(self):
return [self._webkit_baseline_path(self._name)]
@@ -82,27 +75,14 @@
result_set.set_platform(platform)
return result_set
- def _driver_build_script_name(self):
- if self.get_option('webkit_test_runner'):
- return "build-webkittestrunner"
- return "build-dumprendertree"
-
def _build_driver(self):
configuration = self.get_option('configuration')
- try:
- # FIXME: We should probably have a run_script helper which automatically adds the configuration flags.
- self._executive.run_command([
- self._config.script_path(self._driver_build_script_name()),
- self._config.flag_for_configuration(configuration)])
- except ScriptError:
- _log.error("Failed to build %s" % self.driver_name())
- return False
- return True
+ return self._config.build_dumprendertree(configuration)
def _check_driver(self):
driver_path = self._path_to_driver()
if not self._filesystem.exists(driver_path):
- _log.error("%s was not found at %s" % (self.driver_name(), driver_path))
+ _log.error("DumpRenderTree was not found at %s" % driver_path)
return False
return True
@@ -197,6 +177,10 @@
# to have multiple copies of webkit checked out and built.
return self._build_path('layout-test-results')
+ def setup_test_run(self):
+ # This port doesn't require any specific configuration.
+ pass
+
def create_driver(self, worker_number):
return WebKitDriver(self, worker_number)
@@ -443,8 +427,8 @@
if error_lines and error_lines[-1] == "#EOF":
error_lines.pop() # Remove the expected "#EOF"
error = "\n".join(error_lines)
-
- # FIXME: This seems like the wrong section of code to be doing this reset in.
+ # FIXME: This seems like the wrong section of code to be doing
+ # this reset in.
self._server_process.error = ""
return base.DriverOutput(text, image, actual_image_hash, audio,
crash=self._server_process.crashed, test_time=time.time() - start_time,
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py (89847 => 89848)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py 2011-06-27 20:18:54 UTC (rev 89847)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py 2011-06-27 20:53:01 UTC (rev 89848)
@@ -28,25 +28,19 @@
import unittest
from webkitpy.common.system import filesystem_mock
-from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.layout_tests.port.webkit import WebKitPort
from webkitpy.layout_tests.port import port_testcase
-from webkitpy.tool.mocktool import MockExecutive
-from webkitpy.tool.mocktool import MockOptions
-
class TestWebKitPort(WebKitPort):
def __init__(self, symbol_list=None, feature_list=None,
- expectations_file=None, skips_file=None,
- executive=None, **kwargs):
+ expectations_file=None, skips_file=None, **kwargs):
self.symbol_list = symbol_list
self.feature_list = feature_list
self.expectations_file = expectations_file
self.skips_file = skips_file
- executive = executive or MockExecutive(should_log=False)
- WebKitPort.__init__(self, executive=executive, **kwargs)
+ WebKitPort.__init__(self, **kwargs)
def _runtime_feature_list(self):
return self.feature_list
@@ -97,7 +91,8 @@
self.assertEqual(result_directories, expected_directories)
def test_skipped_layout_tests(self):
- self.assertEqual(TestWebKitPort(None, None).skipped_layout_tests(), set(["media"]))
+ self.assertEqual(TestWebKitPort(None, None).skipped_layout_tests(),
+ set(["media"]))
def test_test_expectations(self):
# Check that we read both the expectations file and anything in a
@@ -114,21 +109,6 @@
BUG_SKIPPED SKIP : fast/html/keygen.html = FAIL
BUG_SKIPPED SKIP : media = FAIL""")
- def test_build_driver(self):
- output = OutputCapture()
- port = TestWebKitPort()
- # Delay setting _executive to avoid logging during construction
- port._executive = MockExecutive(should_log=True)
- port._options = MockOptions(configuration="Release") # This should not be necessary, but I think TestWebKitPort is actually reading from disk (and thus detects the current configuration).
- expected_stderr = "MOCK run_command: ['/Projects/WebKit/Tools/Scripts/build-dumprendertree', '--release']\n"
- self.assertTrue(output.assert_outputs(self, port._build_driver, expected_stderr=expected_stderr))
- # Make sure when passed --webkit-test-runner web build the right tool.
- port._options = MockOptions(webkit_test_runner=True, configuration="Release")
- expected_stderr = "MOCK run_command: ['/Projects/WebKit/Tools/Scripts/build-webkittestrunner', '--release']\n"
- self.assertTrue(output.assert_outputs(self, port._build_driver, expected_stderr=expected_stderr))
-
- # Make sure that failure to build returns False.
- port._executive = MockExecutive(should_log=True, should_throw=True)
- expected_stderr = "MOCK run_command: ['/Projects/WebKit/Tools/Scripts/build-webkittestrunner', '--release']\n"
- self.assertFalse(output.assert_outputs(self, port._build_driver, expected_stderr=expected_stderr))
+if __name__ == '__main__':
+ unittest.main()
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py (89847 => 89848)
--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py 2011-06-27 20:18:54 UTC (rev 89847)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py 2011-06-27 20:53:01 UTC (rev 89848)
@@ -268,9 +268,7 @@
optparse.make_option("--complex-text", action="" default=False,
help="Use the complex text code path for all text (Mac OS X and Windows only)"),
optparse.make_option("--threaded", action="" default=False,
- help="Run a concurrent _javascript_ thead with each test"),
- optparse.make_option("--webkit-test-runner", "-2", action=""
- help="Use WebKitTestRunner rather than DumpRenderTree."),
+ help="Run a concurrent _javascript_ thead with each test")
]
# Missing Mac-specific old-run-webkit-tests options:
Modified: trunk/Tools/Scripts/webkitpy/tool/bot/queueengine_unittest.py (89847 => 89848)
--- trunk/Tools/Scripts/webkitpy/tool/bot/queueengine_unittest.py 2011-06-27 20:18:54 UTC (rev 89847)
+++ trunk/Tools/Scripts/webkitpy/tool/bot/queueengine_unittest.py 2011-06-27 20:53:01 UTC (rev 89848)
@@ -160,7 +160,7 @@
if not termination_message:
termination_message = "Delegate terminated queue."
expected_stderr = "\n%s\n" % termination_message
- OutputCapture().assert_outputs(self, engine.run, expected_stderr=expected_stderr)
+ OutputCapture().assert_outputs(self, engine.run, [], expected_stderr=expected_stderr)
def _test_terminating_queue(self, exception, termination_message):
work_item_index = LoggingDelegate.expected_callbacks.index('process_work_item')
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/commandtest.py (89847 => 89848)
--- trunk/Tools/Scripts/webkitpy/tool/commands/commandtest.py 2011-06-27 20:18:54 UTC (rev 89847)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/commandtest.py 2011-06-27 20:53:01 UTC (rev 89848)
@@ -32,7 +32,7 @@
from webkitpy.tool.mocktool import MockOptions, MockTool
class CommandsTest(unittest.TestCase):
- def assert_execute_outputs(self, command, args=[], expected_stdout="", expected_stderr="", expected_exception=None, options=MockOptions(), tool=MockTool()):
+ def assert_execute_outputs(self, command, args, expected_stdout="", expected_stderr="", expected_exception=None, options=MockOptions(), tool=MockTool()):
options.blocks = None
options.cc = 'MOCK cc'
options.component = 'MOCK component'
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py (89847 => 89848)
--- trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py 2011-06-27 20:18:54 UTC (rev 89847)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queues_unittest.py 2011-06-27 20:53:01 UTC (rev 89848)
@@ -166,7 +166,7 @@
tool.status_server = MockStatusServer(work_items=[2, 197])
expected_stdout = "MOCK: fetch_attachment: 2 is not a known attachment id\n" # A mock-only message to prevent us from making mistakes.
expected_stderr = "MOCK: release_work_item: None 2\n"
- patch_id = OutputCapture().assert_outputs(self, queue._next_patch, expected_stdout=expected_stdout, expected_stderr=expected_stderr)
+ patch_id = OutputCapture().assert_outputs(self, queue._next_patch, [], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
self.assertEquals(patch_id, None) # 2 is an invalid patch id
self.assertEquals(queue._next_patch().id(), 197)