Commit e5a00669 authored by dpranke@chromium.org's avatar dpranke@chromium.org

Remove serial test support from test-webkitpy.

Previously test-webkitpy had a way to annotate tests that could not
be run in parallel with other tests. This was useful in rare occasions,
but such tests usually are flaky and slow, so they were gradually removed
and/or reworked. Ultimately this feature wasn't really being used and
was just a source of needless complexity, so I'm killing it.

R=eseidel@chromium.org
BUG=402172

Review URL: https://codereview.chromium.org/458643003

git-svn-id: svn://svn.chromium.org/blink/trunk@180217 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 9b52ad5f
...@@ -165,15 +165,11 @@ class ExecutiveTest(unittest.TestCase): ...@@ -165,15 +165,11 @@ class ExecutiveTest(unittest.TestCase):
output = executive.run_and_throw_if_fail(command_line('echo', unicode_tor_input), quiet=True, decode_output=False) output = executive.run_and_throw_if_fail(command_line('echo', unicode_tor_input), quiet=True, decode_output=False)
self.assertEqual(output, encoded_tor) self.assertEqual(output, encoded_tor)
def serial_test_kill_process(self): def test_kill_process(self):
if sys.platform in ("win32", "cygwin"):
return # Windows does not return consistent exit codes.
executive = Executive() executive = Executive()
process = subprocess.Popen(never_ending_command(), stdout=subprocess.PIPE) process = subprocess.Popen(never_ending_command(), stdout=subprocess.PIPE)
self.assertEqual(process.poll(), None) # Process is running self.assertEqual(process.poll(), None) # Process is running
executive.kill_process(process.pid) executive.kill_process(process.pid)
self.assertEqual(process.wait(), -signal.SIGKILL)
# Killing again should fail silently. # Killing again should fail silently.
executive.kill_process(process.pid) executive.kill_process(process.pid)
...@@ -192,13 +188,13 @@ class ExecutiveTest(unittest.TestCase): ...@@ -192,13 +188,13 @@ class ExecutiveTest(unittest.TestCase):
self._assert_windows_image_name("foo.baz", "foo.baz") self._assert_windows_image_name("foo.baz", "foo.baz")
self._assert_windows_image_name("foo.baz.exe", "foo.baz.exe") self._assert_windows_image_name("foo.baz.exe", "foo.baz.exe")
def serial_test_check_running_pid(self): def test_check_running_pid(self):
executive = Executive() executive = Executive()
self.assertTrue(executive.check_running_pid(os.getpid())) self.assertTrue(executive.check_running_pid(os.getpid()))
# Maximum pid number on Linux is 32768 by default # Maximum pid number on Linux is 32768 by default
self.assertFalse(executive.check_running_pid(100000)) self.assertFalse(executive.check_running_pid(100000))
def serial_test_running_pids(self): def test_running_pids(self):
if sys.platform in ("win32", "cygwin"): if sys.platform in ("win32", "cygwin"):
return # This function isn't implemented on Windows yet. return # This function isn't implemented on Windows yet.
......
...@@ -123,13 +123,6 @@ class AndroidCommandsTest(unittest.TestCase): ...@@ -123,13 +123,6 @@ class AndroidCommandsTest(unittest.TestCase):
def make_android_commands(self, device_count, serial): def make_android_commands(self, device_count, serial):
return android.AndroidCommands(self.make_executive(device_count), serial, debug_logging=False) return android.AndroidCommands(self.make_executive(device_count), serial, debug_logging=False)
# The "adb" binary with the latest version should be used.
def serial_test_adb_command_path(self):
executive = self.make_executive(0)
android.AndroidCommands.set_adb_command_path_options(['path1', 'path2', 'path3'])
self.assertEqual('path2', android.AndroidCommands.adb_command_path(executive, debug_logging=False))
# The used adb command should include the device's serial number, and get_serial() should reflect this. # The used adb command should include the device's serial number, and get_serial() should reflect this.
def test_adb_command_and_get_serial(self): def test_adb_command_and_get_serial(self):
android_commands = self.make_android_commands(1, '123456789ABCDEF0') android_commands = self.make_android_commands(1, '123456789ABCDEF0')
......
...@@ -167,14 +167,13 @@ class Tester(object): ...@@ -167,14 +167,13 @@ class Tester(object):
self.printer.write_update("Finding the individual test methods ...") self.printer.write_update("Finding the individual test methods ...")
loader = _Loader() loader = _Loader()
parallel_tests, serial_tests = self._test_names(loader, names) parallel_tests = self._test_names(loader, names)
self.printer.write_update("Running the tests ...") self.printer.write_update("Running the tests ...")
self.printer.num_tests = len(parallel_tests) + len(serial_tests) self.printer.num_tests = len(parallel_tests)
start = time.time() start = time.time()
test_runner = Runner(self.printer, loader, self.webkit_finder) test_runner = Runner(self.printer, loader, self.webkit_finder)
test_runner.run(parallel_tests, self._options.child_processes) test_runner.run(parallel_tests, self._options.child_processes)
test_runner.run(serial_tests, 1)
self.printer.print_result(time.time() - start) self.printer.print_result(time.time() - start)
...@@ -196,27 +195,15 @@ class Tester(object): ...@@ -196,27 +195,15 @@ class Tester(object):
def _test_names(self, loader, names): def _test_names(self, loader, names):
parallel_test_method_prefixes = ['test_'] parallel_test_method_prefixes = ['test_']
serial_test_method_prefixes = ['serial_test_']
if self._options.integration_tests: if self._options.integration_tests:
parallel_test_method_prefixes.append('integration_test_') parallel_test_method_prefixes.append('integration_test_')
serial_test_method_prefixes.append('serial_integration_test_')
parallel_tests = [] parallel_tests = []
loader.test_method_prefixes = parallel_test_method_prefixes loader.test_method_prefixes = parallel_test_method_prefixes
for name in names: for name in names:
parallel_tests.extend(self._all_test_names(loader.loadTestsFromName(name, None))) parallel_tests.extend(self._all_test_names(loader.loadTestsFromName(name, None)))
serial_tests = [] return parallel_tests
loader.test_method_prefixes = serial_test_method_prefixes
for name in names:
serial_tests.extend(self._all_test_names(loader.loadTestsFromName(name, None)))
# loader.loadTestsFromName() will not verify that names begin with one of the test_method_prefixes
# if the names were explicitly provided (e.g., MainTest.test_basic), so this means that any individual
# tests will be included in both parallel_tests and serial_tests, and we need to de-dup them.
serial_tests = list(set(serial_tests).difference(set(parallel_tests)))
return (parallel_tests, serial_tests)
def _all_test_names(self, suite): def _all_test_names(self, suite):
names = [] names = []
......
...@@ -41,12 +41,6 @@ class TestStubs(unittest.TestCase): ...@@ -41,12 +41,6 @@ class TestStubs(unittest.TestCase):
def integration_test_empty(self): def integration_test_empty(self):
pass pass
def serial_test_empty(self):
pass
def serial_integration_test_empty(self):
pass
class TesterTest(unittest.TestCase): class TesterTest(unittest.TestCase):
...@@ -83,29 +77,19 @@ class TesterTest(unittest.TestCase): ...@@ -83,29 +77,19 @@ class TesterTest(unittest.TestCase):
def test_individual_names_are_not_run_twice(self): def test_individual_names_are_not_run_twice(self):
args = [STUBS_CLASS + '.test_empty'] args = [STUBS_CLASS + '.test_empty']
parallel_tests, serial_tests = self._find_test_names(args) tests = self._find_test_names(args)
self.assertEqual(parallel_tests, args) self.assertEqual(tests, args)
self.assertEqual(serial_tests, [])
def test_integration_tests_are_not_found_by_default(self): def test_integration_tests_are_not_found_by_default(self):
parallel_tests, serial_tests = self._find_test_names([STUBS_CLASS]) tests = self._find_test_names([STUBS_CLASS])
self.assertEqual(parallel_tests, [ self.assertEqual(tests, [STUBS_CLASS + '.test_empty'])
STUBS_CLASS + '.test_empty',
])
self.assertEqual(serial_tests, [
STUBS_CLASS + '.serial_test_empty',
])
def test_integration_tests_are_found(self): def test_integration_tests_are_found(self):
parallel_tests, serial_tests = self._find_test_names(['--integration-tests', STUBS_CLASS]) tests = self._find_test_names(['--integration-tests', STUBS_CLASS])
self.assertEqual(parallel_tests, [ self.assertEqual(tests, [
STUBS_CLASS + '.integration_test_empty', STUBS_CLASS + '.integration_test_empty',
STUBS_CLASS + '.test_empty', STUBS_CLASS + '.test_empty',
]) ])
self.assertEqual(serial_tests, [
STUBS_CLASS + '.serial_integration_test_empty',
STUBS_CLASS + '.serial_test_empty',
])
def test_coverage_works(self): def test_coverage_works(self):
# This is awkward; by design, running test-webkitpy -c will # This is awkward; by design, running test-webkitpy -c will
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment