Reviewed by Eric Seidel.
new-run-webkit-tests: turn off threading on the Chromium Mac port until
we can stabilize the port more and figure out why it is hanging so
frequently.
https://bugs.webkit.org/show_bug.cgi?id=38553
* Scripts/webkitpy/layout_tests/port/chromium_mac.py:
- override default_child_processes() and log a warning
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- fix a typo that caused us to print a method object instead of the
value the method object returns in the case where there is only
one child process.
* Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
- Add unit tests for the output of run_webkit_tests - in this case,
the handling of --child-processes and --print config
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58789
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2010-05-04 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests: turn off threading on the Chromium Mac port until
+ we can stabilize the port more and figure out why it is hanging so
+ frequently.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38553
+
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ - override default_child_processes() and log a warning
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ - fix a typo that caused us to print a method object instead of the
+ value the method object returns in the case where there is only
+ one child process.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+ - Add unit tests for the output of run_webkit_tests - in this case,
+ the handling of --child-processes and --print config
+
2010-05-04 Timothy Hatcher <timothy@apple.com>
Fix the find command in extract-localizable-strings so skip
'MacBuildInstructions')
return result
+ def default_child_processes(self):
+ # FIXME: we need to run single-threaded for now. See
+ # https://bugs.webkit.org/show_bug.cgi?id=38553. Unfortunately this
+ # routine is called right before the logger is configured, so if we
+ # try to _log.warning(), it gets thrown away.
+ import sys
+ sys.stderr.write("Defaulting to one child - see https://bugs.webkit.org/show_bug.cgi?id=38553\n")
+ return 1
+
def driver_name(self):
"""name for this port's equivalent of DumpRenderTree."""
if self._options.use_drt:
return tests
-def run(port_obj, options, args):
+def run(port_obj, options, args, regular_output=sys.stderr,
+ buildbot_output=sys.stdout):
"""Run the tests.
Args:
port_obj: Port object for port-specific behavior
options: a dictionary of command line options
args: a list of sub directories or files to test
- print_results: whether or not to log anything to stdout.
- Set to false by the unit tests
+ regular_output: a stream-like object that we can send logging/debug
+ output to
+ buildbot_output: a stream-like object that we can write all output that
+ is intended to be parsed by the buildbot to
Returns:
the number of unexpected results that occurred, or -1 if there is an
error.
# FIXME: Investigate perf/flakiness impact of using cpu_count + 1.
options.child_processes = port_obj.default_child_processes()
- printer = printing.Printer(port_obj, options, regular_output=sys.stderr,
- buildbot_output=sys.stdout,
+ printer = printing.Printer(port_obj, options, regular_output=regular_output,
+ buildbot_output=buildbot_output,
child_processes=int(options.child_processes),
is_fully_parallel=options.experimental_fully_parallel)
if options.help_printing:
(options.time_out_ms, options.slow_time_out_ms))
if int(options.child_processes) == 1:
- printer.print_config("Running one %s" % port_obj.driver_name)
+ printer.print_config("Running one %s" % port_obj.driver_name())
else:
printer.print_config("Running %s %ss in parallel" % (
options.child_processes, port_obj.driver_name()))
from webkitpy.thirdparty.mock import Mock
+class ArrayStream(object):
+ def __init__(self):
+ self._contents = []
+
+ def write(self, msg):
+ self._contents.append(msg)
+
+ def get(self):
+ return self._contents
+
+ def reset(self):
+ self._contents = []
+
+ def empty(self):
+ return (len(self._contents) == 0)
+
+ def flush(self):
+ pass
+
+ def __repr__(self):
+ return '<ArrayStream: ' + str(self._contents) + '>'
+
+
def passing_run(args, port_obj=None, logging_included=False):
if not logging_included:
args.extend(['--print', 'nothing'])
res = run_webkit_tests.run(port_obj, options, args)
return res == 0
+def logging_run(args):
+ options, args = run_webkit_tests.parse_args(args)
+ port_obj = port.get(options.platform, options)
+ buildbot_output = ArrayStream()
+ regular_output = ArrayStream()
+ res = run_webkit_tests.run(port_obj, options, args,
+ buildbot_output=buildbot_output,
+ regular_output=regular_output)
+ return (res, buildbot_output, regular_output)
+
class MainTest(unittest.TestCase):
def test_fast(self):
'--print', 'unexpected',
'fast/html']))
+ def test_child_processes(self):
+ (res, buildbot_output, regular_output) = logging_run(
+ ['--platform', 'test', '--print', 'config', '--child-processes',
+ '1', 'fast/html'])
+ self.assertTrue('Running one DumpRenderTree\n'
+ in regular_output.get())
+
+ (res, buildbot_output, regular_output) = logging_run(
+ ['--platform', 'test', '--print', 'config', '--child-processes',
+ '2', 'fast/html'])
+ self.assertTrue('Running 2 DumpRenderTrees in parallel\n'
+ in regular_output.get())
+
+
class TestRunnerTest(unittest.TestCase):
def test_results_html(self):