| Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py
|
| diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py
|
| index f0d1af24407c82abeabe0ced36f0a7f2023bdec0..21a186b3d3be23d3bf2616ccb42a4687ee840408 100644
|
| --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py
|
| +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner_unittest.py
|
| @@ -71,6 +71,7 @@ class FakePrinter(object):
|
|
|
|
|
| class LockCheckingRunner(LayoutTestRunner):
|
| +
|
| def __init__(self, port, options, printer, tester, http_lock):
|
| super(LockCheckingRunner, self).__init__(options, port, printer, port.results_directory(), lambda test_name: False)
|
| self._finished_list_called = False
|
| @@ -92,6 +93,7 @@ class LockCheckingRunner(LayoutTestRunner):
|
|
|
|
|
| class LayoutTestRunnerTests(unittest.TestCase):
|
| +
|
| def _runner(self, port=None):
|
| # FIXME: we shouldn't have to use run_webkit_tests.py to get the options we need.
|
| options = run_webkit_tests.parse_args(['--platform', 'test-mac-mac10.11'])[0]
|
| @@ -180,7 +182,7 @@ class SharderTests(unittest.TestCase):
|
| self.sharder = Sharder(port.split_test, max_locked_shards)
|
| test_list = test_list or self.test_list
|
| return self.sharder.shard_tests([self.get_test_input(test) for test in test_list],
|
| - num_workers, fully_parallel, run_singly)
|
| + num_workers, fully_parallel, run_singly)
|
|
|
| def assert_shards(self, actual_shards, expected_shard_names):
|
| self.assertEqual(len(actual_shards), len(expected_shard_names))
|
| @@ -188,7 +190,7 @@ class SharderTests(unittest.TestCase):
|
| expected_shard_name, expected_test_names = expected_shard_names[i]
|
| self.assertEqual(shard.name, expected_shard_name)
|
| self.assertEqual([test_input.test_name for test_input in shard.test_inputs],
|
| - expected_test_names)
|
| + expected_test_names)
|
|
|
| def test_shard_by_dir(self):
|
| locked, unlocked = self.get_shards(num_workers=2, fully_parallel=False, run_singly=False)
|
| @@ -197,99 +199,99 @@ class SharderTests(unittest.TestCase):
|
| # they are crammed into a single shard in order to reduce the # of
|
| # workers hitting the server at once.
|
| self.assert_shards(locked,
|
| - [('locked_shard_1',
|
| - ['http/tests/security/view-source-no-refresh.html',
|
| - 'http/tests/websocket/tests/unicode.htm',
|
| - 'http/tests/websocket/tests/websocket-protocol-ignored.html',
|
| - 'http/tests/xmlhttprequest/supported-xml-content-types.html',
|
| - 'perf/object-keys.html'])])
|
| + [('locked_shard_1',
|
| + ['http/tests/security/view-source-no-refresh.html',
|
| + 'http/tests/websocket/tests/unicode.htm',
|
| + 'http/tests/websocket/tests/websocket-protocol-ignored.html',
|
| + 'http/tests/xmlhttprequest/supported-xml-content-types.html',
|
| + 'perf/object-keys.html'])])
|
| self.assert_shards(unlocked,
|
| - [('virtual/threaded/dir', ['virtual/threaded/dir/test.html']),
|
| - ('virtual/threaded/fast/foo', ['virtual/threaded/fast/foo/test.html']),
|
| - ('animations', ['animations/keyframes.html']),
|
| - ('dom/html/level2/html', ['dom/html/level2/html/HTMLAnchorElement03.html',
|
| - 'dom/html/level2/html/HTMLAnchorElement06.html']),
|
| - ('fast/css', ['fast/css/display-none-inline-style-change-crash.html'])])
|
| + [('virtual/threaded/dir', ['virtual/threaded/dir/test.html']),
|
| + ('virtual/threaded/fast/foo', ['virtual/threaded/fast/foo/test.html']),
|
| + ('animations', ['animations/keyframes.html']),
|
| + ('dom/html/level2/html', ['dom/html/level2/html/HTMLAnchorElement03.html',
|
| + 'dom/html/level2/html/HTMLAnchorElement06.html']),
|
| + ('fast/css', ['fast/css/display-none-inline-style-change-crash.html'])])
|
|
|
| def test_shard_every_file(self):
|
| locked, unlocked = self.get_shards(num_workers=2, fully_parallel=True, max_locked_shards=2, run_singly=False)
|
| self.assert_shards(locked,
|
| - [('locked_shard_1',
|
| - ['http/tests/websocket/tests/unicode.htm',
|
| - 'http/tests/security/view-source-no-refresh.html',
|
| - 'http/tests/websocket/tests/websocket-protocol-ignored.html']),
|
| - ('locked_shard_2',
|
| - ['http/tests/xmlhttprequest/supported-xml-content-types.html',
|
| - 'perf/object-keys.html'])]),
|
| + [('locked_shard_1',
|
| + ['http/tests/websocket/tests/unicode.htm',
|
| + 'http/tests/security/view-source-no-refresh.html',
|
| + 'http/tests/websocket/tests/websocket-protocol-ignored.html']),
|
| + ('locked_shard_2',
|
| + ['http/tests/xmlhttprequest/supported-xml-content-types.html',
|
| + 'perf/object-keys.html'])]),
|
| self.assert_shards(unlocked,
|
| - [('virtual/threaded/dir', ['virtual/threaded/dir/test.html']),
|
| - ('virtual/threaded/fast/foo', ['virtual/threaded/fast/foo/test.html']),
|
| - ('.', ['animations/keyframes.html']),
|
| - ('.', ['fast/css/display-none-inline-style-change-crash.html']),
|
| - ('.', ['dom/html/level2/html/HTMLAnchorElement03.html']),
|
| - ('.', ['dom/html/level2/html/HTMLAnchorElement06.html'])])
|
| + [('virtual/threaded/dir', ['virtual/threaded/dir/test.html']),
|
| + ('virtual/threaded/fast/foo', ['virtual/threaded/fast/foo/test.html']),
|
| + ('.', ['animations/keyframes.html']),
|
| + ('.', ['fast/css/display-none-inline-style-change-crash.html']),
|
| + ('.', ['dom/html/level2/html/HTMLAnchorElement03.html']),
|
| + ('.', ['dom/html/level2/html/HTMLAnchorElement06.html'])])
|
|
|
| def test_shard_in_two(self):
|
| locked, unlocked = self.get_shards(num_workers=1, fully_parallel=False, run_singly=False)
|
| self.assert_shards(locked,
|
| - [('locked_tests',
|
| - ['http/tests/websocket/tests/unicode.htm',
|
| - 'http/tests/security/view-source-no-refresh.html',
|
| - 'http/tests/websocket/tests/websocket-protocol-ignored.html',
|
| - 'http/tests/xmlhttprequest/supported-xml-content-types.html',
|
| - 'perf/object-keys.html'])])
|
| + [('locked_tests',
|
| + ['http/tests/websocket/tests/unicode.htm',
|
| + 'http/tests/security/view-source-no-refresh.html',
|
| + 'http/tests/websocket/tests/websocket-protocol-ignored.html',
|
| + 'http/tests/xmlhttprequest/supported-xml-content-types.html',
|
| + 'perf/object-keys.html'])])
|
| self.assert_shards(unlocked,
|
| - [('unlocked_tests',
|
| - ['animations/keyframes.html',
|
| - 'fast/css/display-none-inline-style-change-crash.html',
|
| - 'dom/html/level2/html/HTMLAnchorElement03.html',
|
| - 'dom/html/level2/html/HTMLAnchorElement06.html',
|
| - 'virtual/threaded/dir/test.html',
|
| - 'virtual/threaded/fast/foo/test.html'])])
|
| + [('unlocked_tests',
|
| + ['animations/keyframes.html',
|
| + 'fast/css/display-none-inline-style-change-crash.html',
|
| + 'dom/html/level2/html/HTMLAnchorElement03.html',
|
| + 'dom/html/level2/html/HTMLAnchorElement06.html',
|
| + 'virtual/threaded/dir/test.html',
|
| + 'virtual/threaded/fast/foo/test.html'])])
|
|
|
| def test_shard_in_two_has_no_locked_shards(self):
|
| locked, unlocked = self.get_shards(num_workers=1, fully_parallel=False, run_singly=False,
|
| - test_list=['animations/keyframe.html'])
|
| + test_list=['animations/keyframe.html'])
|
| self.assertEqual(len(locked), 0)
|
| self.assertEqual(len(unlocked), 1)
|
|
|
| def test_shard_in_two_has_no_unlocked_shards(self):
|
| locked, unlocked = self.get_shards(num_workers=1, fully_parallel=False, run_singly=False,
|
| - test_list=['http/tests/websocket/tests/unicode.htm'])
|
| + test_list=['http/tests/websocket/tests/unicode.htm'])
|
| self.assertEqual(len(locked), 1)
|
| self.assertEqual(len(unlocked), 0)
|
|
|
| def test_multiple_locked_shards(self):
|
| locked, unlocked = self.get_shards(num_workers=4, fully_parallel=False, max_locked_shards=2, run_singly=False)
|
| self.assert_shards(locked,
|
| - [('locked_shard_1',
|
| - ['http/tests/security/view-source-no-refresh.html',
|
| - 'http/tests/websocket/tests/unicode.htm',
|
| - 'http/tests/websocket/tests/websocket-protocol-ignored.html']),
|
| - ('locked_shard_2',
|
| - ['http/tests/xmlhttprequest/supported-xml-content-types.html',
|
| - 'perf/object-keys.html'])])
|
| + [('locked_shard_1',
|
| + ['http/tests/security/view-source-no-refresh.html',
|
| + 'http/tests/websocket/tests/unicode.htm',
|
| + 'http/tests/websocket/tests/websocket-protocol-ignored.html']),
|
| + ('locked_shard_2',
|
| + ['http/tests/xmlhttprequest/supported-xml-content-types.html',
|
| + 'perf/object-keys.html'])])
|
|
|
| locked, unlocked = self.get_shards(num_workers=4, fully_parallel=False, run_singly=False)
|
| self.assert_shards(locked,
|
| - [('locked_shard_1',
|
| - ['http/tests/security/view-source-no-refresh.html',
|
| - 'http/tests/websocket/tests/unicode.htm',
|
| - 'http/tests/websocket/tests/websocket-protocol-ignored.html',
|
| - 'http/tests/xmlhttprequest/supported-xml-content-types.html',
|
| - 'perf/object-keys.html'])])
|
| + [('locked_shard_1',
|
| + ['http/tests/security/view-source-no-refresh.html',
|
| + 'http/tests/websocket/tests/unicode.htm',
|
| + 'http/tests/websocket/tests/websocket-protocol-ignored.html',
|
| + 'http/tests/xmlhttprequest/supported-xml-content-types.html',
|
| + 'perf/object-keys.html'])])
|
|
|
| def test_virtual_shards(self):
|
| # With run_singly=False, we try to keep all of the tests in a virtual suite together even
|
| # when fully_parallel=True, so that we don't restart every time the command line args change.
|
| locked, unlocked = self.get_shards(num_workers=2, fully_parallel=True, max_locked_shards=2, run_singly=False,
|
| - test_list=['virtual/foo/bar1.html', 'virtual/foo/bar2.html'])
|
| + test_list=['virtual/foo/bar1.html', 'virtual/foo/bar2.html'])
|
| self.assert_shards(unlocked,
|
| - [('virtual/foo', ['virtual/foo/bar1.html', 'virtual/foo/bar2.html'])])
|
| + [('virtual/foo', ['virtual/foo/bar1.html', 'virtual/foo/bar2.html'])])
|
|
|
| # But, with run_singly=True, we have to restart every time anyway, so we want full parallelism.
|
| locked, unlocked = self.get_shards(num_workers=2, fully_parallel=True, max_locked_shards=2, run_singly=True,
|
| - test_list=['virtual/foo/bar1.html', 'virtual/foo/bar2.html'])
|
| + test_list=['virtual/foo/bar1.html', 'virtual/foo/bar2.html'])
|
| self.assert_shards(unlocked,
|
| - [('.', ['virtual/foo/bar1.html']),
|
| - ('.', ['virtual/foo/bar2.html'])])
|
| + [('.', ['virtual/foo/bar1.html']),
|
| + ('.', ['virtual/foo/bar2.html'])])
|
|
|