https://bugs.webkit.org/show_bug.cgi?id=139427
Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-12-09
Reviewed by Alexey Proskuryakov.
It seems that the only concrete client of virtual tests is the unit tests :D
This patch tries to clean as much useless code as possible.
* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
(RunTest.test_tolerance):
(RunTest.test_virtual): Deleted.
* Scripts/webkitpy/layout_tests/views/printing.py:
(Printer._print_test_trace):
* Scripts/webkitpy/port/base.py:
(Port.expected_filename):
(Port.tests):
(Port.test_isfile):
(Port.test_isdir):
(Port.sample_process):
(Port.find_system_pid):
(Port.test_expectations_file_position):
(Port.virtual_test_suites): Deleted.
(Port): Deleted.
(Port.populated_virtual_test_suites): Deleted.
(Port._virtual_tests): Deleted.
(Port.lookup_virtual_test_base): Deleted.
(Port.lookup_virtual_test_args): Deleted.
(VirtualTestSuite): Deleted.
(VirtualTestSuite.__init__): Deleted.
(VirtualTestSuite.__repr__): Deleted.
* Scripts/webkitpy/port/base_unittest.py:
(PortTest.test_test_exists):
(PortTest.test_test_isfile):
(PortTest.test_test_isdir):
(PortTest.test_tests):
* Scripts/webkitpy/port/driver.py:
(DriverProxy.run_test): Deleted.
* Scripts/webkitpy/port/test.py:
(TestPort._skipped_tests_for_unsupported_features):
(TestPort.all_baseline_variants):
(TestPort.virtual_test_suites): Deleted.
* Scripts/webkitpy/tool/commands/queries.py:
(PrintBaselines.__init__):
(PrintBaselines.execute):
* Scripts/webkitpy/tool/commands/queries_unittest.py:
(PrintBaselinesTest.test_basic):
(PrintBaselinesTest.test_multiple):
(PrintBaselinesTest.test_csv):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177034
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-12-09 Benjamin Poulain <bpoulain@apple.com>
+
+ Remove virtual test support from webkitpy
+ https://bugs.webkit.org/show_bug.cgi?id=139427
+
+ Reviewed by Alexey Proskuryakov.
+
+ It seems that the only concrete client of virtual tests is the unit tests :D
+
+ This patch tries to clean as much useless code as possible.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
+ (RunTest.test_tolerance):
+ (RunTest.test_virtual): Deleted.
+ * Scripts/webkitpy/layout_tests/views/printing.py:
+ (Printer._print_test_trace):
+ * Scripts/webkitpy/port/base.py:
+ (Port.expected_filename):
+ (Port.tests):
+ (Port.test_isfile):
+ (Port.test_isdir):
+ (Port.sample_process):
+ (Port.find_system_pid):
+ (Port.test_expectations_file_position):
+ (Port.virtual_test_suites): Deleted.
+ (Port): Deleted.
+ (Port.populated_virtual_test_suites): Deleted.
+ (Port._virtual_tests): Deleted.
+ (Port.lookup_virtual_test_base): Deleted.
+ (Port.lookup_virtual_test_args): Deleted.
+ (VirtualTestSuite): Deleted.
+ (VirtualTestSuite.__init__): Deleted.
+ (VirtualTestSuite.__repr__): Deleted.
+ * Scripts/webkitpy/port/base_unittest.py:
+ (PortTest.test_test_exists):
+ (PortTest.test_test_isfile):
+ (PortTest.test_test_isdir):
+ (PortTest.test_tests):
+ * Scripts/webkitpy/port/driver.py:
+ (DriverProxy.run_test): Deleted.
+ * Scripts/webkitpy/port/test.py:
+ (TestPort._skipped_tests_for_unsupported_features):
+ (TestPort.all_baseline_variants):
+ (TestPort.virtual_test_suites): Deleted.
+ * Scripts/webkitpy/tool/commands/queries.py:
+ (PrintBaselines.__init__):
+ (PrintBaselines.execute):
+ * Scripts/webkitpy/tool/commands/queries_unittest.py:
+ (PrintBaselinesTest.test_basic):
+ (PrintBaselinesTest.test_multiple):
+ (PrintBaselinesTest.test_csv):
+
2014-12-09 Csaba Osztrogonác <ossy@webkit.org>
Blink Merge: Remove 'http_lock' code from webkitpy
test_port = get_port_for_run(base_args)
self.assertEqual(None, test_port.tolerance_used_for_diff_image)
- def test_virtual(self):
- self.assertTrue(passing_run(['passes/text.html', 'passes/args.html',
- 'virtual/passes/text.html', 'virtual/passes/args.html']))
-
def test_reftest_run(self):
tests_run = get_tests_run(['passes/reftest.html'])
self.assertEqual(['passes/reftest.html'], tests_run)
test_name = result.test_name
self._print_default(self._test_status_line(test_name, ''))
- base = self._port.lookup_virtual_test_base(test_name)
- if base:
- args = ' '.join(self._port.lookup_virtual_test_args(test_name))
- self._print_default(' base: %s' % base)
- self._print_default(' args: %s' % args)
-
for extension in ('.txt', '.png', '.wav', '.webarchive'):
self._print_baseline(test_name, extension)
if platform_dir:
return self._filesystem.join(platform_dir, baseline_filename)
- actual_test_name = self.lookup_virtual_test_base(test_name)
- if actual_test_name:
- return self.expected_filename(actual_test_name, suffix)
-
if return_default:
return self._filesystem.join(self.layout_tests_dir(), baseline_filename)
return None
def tests(self, paths):
"""Return the list of tests found. Both generic and platform-specific tests matching paths should be returned."""
expanded_paths = self._expanded_paths(paths)
- tests = self._real_tests(expanded_paths)
- tests.extend(self._virtual_tests(expanded_paths, self.populated_virtual_test_suites()))
- return tests
+ return self._real_tests(expanded_paths)
def _expanded_paths(self, paths):
expanded_paths = []
def test_isfile(self, test_name):
"""Return True if the test name refers to a directory of tests."""
# Used by test_expectations.py to apply rules to whole directories.
- if self._filesystem.isfile(self.abspath_for_test(test_name)):
- return True
- base = self.lookup_virtual_test_base(test_name)
- return base and self._filesystem.isfile(self.abspath_for_test(base))
+ return self._filesystem.isfile(self.abspath_for_test(test_name))
@memoized
def test_isdir(self, test_name):
"""Return True if the test name refers to a directory of tests."""
# Used by test_expectations.py to apply rules to whole directories.
- if self._filesystem.isdir(self.abspath_for_test(test_name)):
- return True
- base = self.lookup_virtual_test_base(test_name)
- return base and self._filesystem.isdir(self.abspath_for_test(base))
+ return self._filesystem.isdir(self.abspath_for_test(test_name))
@memoized
def test_exists(self, test_name):
def sample_process(self, name, pid):
pass
- def virtual_test_suites(self):
- return []
-
def find_system_pid(self, name, pid):
# This is only overridden on Windows
return pid
- @memoized
- def populated_virtual_test_suites(self):
- suites = self.virtual_test_suites()
-
- # Sanity-check the suites to make sure they don't point to other suites.
- suite_dirs = [suite.name for suite in suites]
- for suite in suites:
- assert suite.base not in suite_dirs
-
- for suite in suites:
- base_tests = self._real_tests([suite.base])
- suite.tests = {}
- for test in base_tests:
- suite.tests[test.replace(suite.base, suite.name, 1)] = test
- return suites
-
- def _virtual_tests(self, paths, suites):
- virtual_tests = list()
- for suite in suites:
- if paths:
- for test in suite.tests:
- if any(test.startswith(p) for p in paths):
- virtual_tests.append(test)
- else:
- virtual_tests.extend(suite.tests.keys())
- return virtual_tests
-
- def lookup_virtual_test_base(self, test_name):
- for suite in self.populated_virtual_test_suites():
- if test_name.startswith(suite.name):
- return test_name.replace(suite.name, suite.base, 1)
- return None
-
- def lookup_virtual_test_args(self, test_name):
- for suite in self.populated_virtual_test_suites():
- if test_name.startswith(suite.name):
- return suite.args
- return []
-
def should_run_as_pixel_test(self, test_input):
if not self._options.pixel_tests:
return False
def test_expectations_file_position(self):
# By default baseline search path schema is i.e. port-wk2 -> wk2 -> port -> generic, so port expectations file is at second to last position.
return 1
-
-class VirtualTestSuite(object):
- def __init__(self, name, base, args, tests=None):
- self.name = name
- self.base = base
- self.args = args
- self.tests = tests or set()
-
- def __repr__(self):
- return "VirtualTestSuite('%s', '%s', %s)" % (self.name, self.base, self.args)
self.assertTrue(port.test_exists('passes/text.html'))
self.assertFalse(port.test_exists('passes/does_not_exist.html'))
- self.assertTrue(port.test_exists('virtual'))
- self.assertFalse(port.test_exists('virtual/does_not_exist.html'))
- self.assertTrue(port.test_exists('virtual/passes/text.html'))
-
def test_test_isfile(self):
port = self.make_port(with_tests=True)
self.assertFalse(port.test_isfile('passes'))
self.assertTrue(port.test_isfile('passes/text.html'))
self.assertFalse(port.test_isfile('passes/does_not_exist.html'))
- self.assertFalse(port.test_isfile('virtual'))
- self.assertTrue(port.test_isfile('virtual/passes/text.html'))
- self.assertFalse(port.test_isfile('virtual/does_not_exist.html'))
-
def test_test_isdir(self):
port = self.make_port(with_tests=True)
self.assertTrue(port.test_isdir('passes'))
self.assertFalse(port.test_isdir('passes/does_not_exist.html'))
self.assertFalse(port.test_isdir('passes/does_not_exist/'))
- self.assertTrue(port.test_isdir('virtual'))
- self.assertFalse(port.test_isdir('virtual/does_not_exist.html'))
- self.assertFalse(port.test_isdir('virtual/does_not_exist/'))
- self.assertFalse(port.test_isdir('virtual/passes/text.html'))
-
def test_tests(self):
port = self.make_port(with_tests=True)
tests = port.tests([])
self.assertIn('passes/text.html', tests)
- self.assertIn('virtual/passes/text.html', tests)
tests = port.tests(['passes'])
self.assertIn('passes/text.html', tests)
- self.assertIn('passes/passes/test-virtual-passes.html', tests)
- self.assertNotIn('virtual/passes/text.html', tests)
-
- tests = port.tests(['virtual/passes'])
- self.assertNotIn('passes/text.html', tests)
- self.assertIn('virtual/passes/test-virtual-passes.html', tests)
- self.assertIn('virtual/passes/passes/test-virtual-passes.html', tests)
- self.assertNotIn('virtual/passes/test-virtual-virtual/passes.html', tests)
- self.assertNotIn('virtual/passes/virtual/passes/test-virtual-passes.html', tests)
def test_build_path(self):
port = self.make_port(options=optparse.Values({'build_directory': '/my-build-directory/'}))
return self._driver.uri_to_test(uri)
def run_test(self, driver_input, stop_when_done):
- base = self._port.lookup_virtual_test_base(driver_input.test_name)
- if base:
- virtual_driver_input = copy.copy(driver_input)
- virtual_driver_input.test_name = base
- virtual_driver_input.args = self._port.lookup_virtual_test_args(driver_input.test_name)
- return self.run_test(virtual_driver_input, stop_when_done)
-
pixel_tests_needed = driver_input.should_run_pixel_test
cmd_line_key = self._cmd_line_as_key(pixel_tests_needed, driver_input.args)
if cmd_line_key != self._driver_cmd_line:
import time
from webkitpy.port import Port, Driver, DriverOutput
-from webkitpy.port.base import VirtualTestSuite
from webkitpy.layout_tests.models.test_configuration import TestConfiguration
from webkitpy.common.system.filesystem_mock import MockFileSystem
from webkitpy.common.system.crashlogs import CrashLogs
#
# These numbers may need to be updated whenever we add or delete tests.
#
-TOTAL_TESTS = 107
+TOTAL_TESTS = 71
TOTAL_SKIPS = 28
TOTAL_RETRIES = 14
actual_image='image_not_in_pixeldir-pngtEXtchecksum\x00checksum_fail',
expected_image='image_not_in_pixeldir-pngtEXtchecksum\x00checksum-png')
- # For testing that virtual test suites don't expand names containing themselves
- # See webkit.org/b/97925 and base_unittest.PortTest.test_tests().
- tests.add('passes/test-virtual-passes.html')
- tests.add('passes/passes/test-virtual-passes.html')
-
return tests
add_file(test, '-expected.txt', test.expected_text)
add_file(test, '-expected.png', test.expected_image)
- filesystem.write_text_file(filesystem.join(LAYOUT_TEST_DIR, 'virtual', 'passes', 'args-expected.txt'), 'args-txt --virtual-arg')
# Clear the list of written files so that we can watch what happens during testing.
filesystem.clear_written_files()
def _skipped_tests_for_unsupported_features(self, test_list):
return set(['failures/expected/skip_text.html',
- 'failures/unexpected/skip_pass.html',
- 'virtual/skipped'])
+ 'failures/unexpected/skip_pass.html'])
def name(self):
return self._name
def all_baseline_variants(self):
return self.ALL_BASELINE_VARIANTS
- def virtual_test_suites(self):
- return [
- VirtualTestSuite('virtual/passes', 'passes', ['--virtual-arg']),
- VirtualTestSuite('virtual/skipped', 'failures/expected', ['--virtual-arg2']),
- ]
-
-
class TestDriver(Driver):
"""Test/Dummy implementation of the DumpRenderTree interface."""
next_pid = 1
help='display the baselines for *all* tests'),
make_option('--csv', action='store_true', default=False,
help='Print a CSV-style report that includes the port name, test_name, test platform, baseline type, baseline location, and baseline platform'),
- make_option('--include-virtual-tests', action='store_true',
- help='Include virtual tests'),
] + platform_options(use_globs=True)
Command.__init__(self, options=options)
self._platform_regexp = re.compile('platform/([^\/]+)/(.+)')
else:
port_names = [default_port.name()]
- if options.include_virtual_tests:
- tests = sorted(default_port.tests(args))
- else:
- # FIXME: make real_tests() a public method.
- tests = sorted(default_port._real_tests(args))
+ # FIXME: make real_tests() a public method.
+ tests = sorted(default_port._real_tests(args))
for port_name in port_names:
if port_name != port_names[0]:
command = PrintBaselines()
command.bind_to_tool(self.tool)
self.capture_output()
- command.execute(MockOptions(all=False, include_virtual_tests=False, csv=False, platform=None), ['passes/text.html'], self.tool)
+ command.execute(MockOptions(all=False, csv=False, platform=None), ['passes/text.html'], self.tool)
stdout, _, _ = self.restore_output()
self.assertMultiLineEqual(stdout,
('// For test-win-xp\n'
command = PrintBaselines()
command.bind_to_tool(self.tool)
self.capture_output()
- command.execute(MockOptions(all=False, include_virtual_tests=False, csv=False, platform='test-win-*'), ['passes/text.html'], self.tool)
+ command.execute(MockOptions(all=False, csv=False, platform='test-win-*'), ['passes/text.html'], self.tool)
stdout, _, _ = self.restore_output()
self.assertMultiLineEqual(stdout,
('// For test-win-vista\n'
command = PrintBaselines()
command.bind_to_tool(self.tool)
self.capture_output()
- command.execute(MockOptions(all=False, platform='*xp', csv=True, include_virtual_tests=False), ['passes/text.html'], self.tool)
+ command.execute(MockOptions(all=False, platform='*xp', csv=True), ['passes/text.html'], self.tool)
stdout, _, _ = self.restore_output()
self.assertMultiLineEqual(stdout,
('test-win-xp,passes/text.html,None,png,passes/text-expected.png,None\n'