- Revision
- 113927
- Author
- [email protected]
- Date
- 2012-04-11 17:13:39 -0700 (Wed, 11 Apr 2012)
Log Message
new-run-webkit-tests: 'webkit-patch skipped-ports' introduced bad layering
https://bugs.webkit.org/show_bug.cgi?id=47528
Reviewed by Adam Barth.
The skipped-ports command has been replaced by 'webkit-patch
print-expectations', which offers the equivalent functionality
via 'webkit-patch print-expectations --platform \* -t skip'
(and other features, of course).
This also allows me to fix a nasty layering violation where the
chromium port had to know about the TestExpectations objects in
order to implement the command properly.
Lastly, this allows me to rename skipped_tests() to
skipped_layout_tests() to more consistent with
skipped_perf_tests().
This patch removes skips_layout_test() from the Port interface,
because that can't be implemented without the port knowing about
Expectations objects (and skipped-ports was the only thing using it).
* Scripts/webkitpy/layout_tests/port/base.py:
(Port.skipped_layout_tests):
(Port.skipped_perf_tests):
* Scripts/webkitpy/layout_tests/port/base_unittest.py:
(PortTest.test_default_configuration_notfound):
* Scripts/webkitpy/layout_tests/port/chromium.py:
(ChromiumPort.test_expectations_overrides):
* Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
(ChromiumPortTest.test_path_to_image_diff):
* Scripts/webkitpy/layout_tests/port/webkit.py:
(WebKitPort.skipped_layout_tests):
* Scripts/webkitpy/tool/commands/queries.py:
(execute):
* Scripts/webkitpy/tool/commands/queries_unittest.py:
(QueryCommandsTest.test_tree_status):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (113926 => 113927)
--- trunk/Tools/ChangeLog 2012-04-11 23:46:20 UTC (rev 113926)
+++ trunk/Tools/ChangeLog 2012-04-12 00:13:39 UTC (rev 113927)
@@ -1,3 +1,43 @@
+2012-04-11 Dirk Pranke <[email protected]>
+
+ new-run-webkit-tests: 'webkit-patch skipped-ports' introduced bad layering
+ https://bugs.webkit.org/show_bug.cgi?id=47528
+
+ Reviewed by Adam Barth.
+
+ The skipped-ports command has been replaced by 'webkit-patch
+ print-expectations', which offers the equivalent functionality
+ via 'webkit-patch print-expectations --platform \* -t skip'
+ (and other features, of course).
+
+ This also allows me to fix a nasty layering violation where the
+ chromium port had to know about the TestExpectations objects in
+ order to implement the command properly.
+
+ Lastly, this allows me to rename skipped_tests() to
+ skipped_layout_tests() to more consistent with
+ skipped_perf_tests().
+
+ This patch removes skips_layout_test() from the Port interface,
+ because that can't be implemented without the port knowing about
+ Expectations objects (and skipped-ports was the only thing using it).
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ (Port.skipped_layout_tests):
+ (Port.skipped_perf_tests):
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ (PortTest.test_default_configuration_notfound):
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ (ChromiumPort.test_expectations_overrides):
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+ (ChromiumPortTest.test_path_to_image_diff):
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ (WebKitPort.skipped_layout_tests):
+ * Scripts/webkitpy/tool/commands/queries.py:
+ (execute):
+ * Scripts/webkitpy/tool/commands/queries_unittest.py:
+ (QueryCommandsTest.test_tree_status):
+
2012-04-11 Mark Rowe <[email protected]>
Remove a fprintf from LayoutTestController.
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py (113926 => 113927)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2012-04-11 23:46:20 UTC (rev 113926)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py 2012-04-12 00:13:39 UTC (rev 113927)
@@ -594,8 +594,9 @@
def webkit_base(self):
return self._filesystem.abspath(self.path_from_webkit_base('.'))
- def skipped_layout_tests(self):
- return []
+ def skipped_layout_tests(self, test_list):
+ """Returns the set of tests found in Skipped files. Does *not* include tests marked as SKIP in expectations files."""
+ return set([])
def _tests_from_skipped_file_contents(self, skipped_file_contents):
tests_to_skip = []
@@ -623,21 +624,6 @@
def skipped_perf_tests(self):
return self._expectations_from_skipped_files([self.perf_tests_dir()])
- def skipped_tests(self, test_list):
- return set([])
-
- def skips_layout_test(self, test_name):
- """Figures out if the givent test is being skipped or not.
-
- Test categories are handled as well."""
- for test_or_category in self.skipped_layout_tests():
- if test_or_category == test_name:
- return True
- category = self._filesystem.join(self.layout_tests_dir(), test_or_category)
- if self._filesystem.isdir(category) and test_name.startswith(test_or_category):
- return True
- return False
-
def skips_perf_test(self, test_name):
for test_or_category in self.skipped_perf_tests():
if test_or_category == test_name:
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py (113926 => 113927)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py 2012-04-11 23:46:20 UTC (rev 113926)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py 2012-04-12 00:13:39 UTC (rev 113927)
@@ -208,15 +208,6 @@
port = self.make_port(config=config_mock.MockConfig(default_configuration='default'))
self.assertEqual(port.default_configuration(), 'default')
- def test_layout_tests_skipping(self):
- port = self.make_port()
- port.host.filesystem.write_text_file(port.layout_tests_dir() + '/media/video-zoom.html', '')
- port.host.filesystem.write_text_file(port.layout_tests_dir() + '/foo/bar.html', '')
- port.skipped_layout_tests = lambda: ['foo/bar.html', 'media']
- self.assertTrue(port.skips_layout_test('foo/bar.html'))
- self.assertTrue(port.skips_layout_test('media/video-zoom.html'))
- self.assertFalse(port.skips_layout_test('foo/foo.html'))
-
def test_setup_test_run(self):
port = self.make_port()
# This routine is a no-op. We just test it for coverage.
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py (113926 => 113927)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py 2012-04-11 23:46:20 UTC (rev 113926)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py 2012-04-12 00:13:39 UTC (rev 113927)
@@ -321,20 +321,6 @@
return None
return self._filesystem.read_text_file(overrides_path)
- def skipped_layout_tests(self, extra_test_files=None):
- expectations_str = self.test_expectations()
- overrides_str = self.test_expectations_overrides()
- is_debug_mode = False
-
- all_test_files = self.tests([])
- if extra_test_files:
- all_test_files.update(extra_test_files)
-
- expectations = test_expectations.TestExpectations(
- self, all_test_files, expectations_str, self.test_configuration(),
- is_lint_mode=False, overrides=overrides_str)
- return expectations.get_tests_with_result_type(test_expectations.SKIP)
-
def repository_paths(self):
repos = super(ChromiumPort, self).repository_paths()
repos.append(('chromium', self.path_from_chromium_base('build')))
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py (113926 => 113927)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py 2012-04-11 23:46:20 UTC (rev 113926)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py 2012-04-12 00:13:39 UTC (rev 113927)
@@ -244,22 +244,6 @@
self.assertTrue(ChromiumPortTest.TestMacPort()._path_to_image_diff().endswith('/xcodebuild/default/ImageDiff'))
self.assertTrue(ChromiumPortTest.TestWinPort()._path_to_image_diff().endswith('/default/ImageDiff.exe'))
- def test_skipped_layout_tests(self):
- mock_options = MockOptions()
- mock_options.configuration = 'release'
- port = ChromiumPortTest.TestLinuxPort(options=mock_options)
-
- fake_test = 'fast/js/not-good.js'
-
- port.test_expectations = lambda: """BUG_TEST SKIP : fast/js/not-good.js = TEXT
-LINUX WIN : fast/js/very-good.js = TIMEOUT PASS"""
- port.test_expectations_overrides = lambda: ''
- port.tests = lambda paths: set()
- port.test_exists = lambda test: True
-
- skipped_tests = port.skipped_layout_tests(extra_test_files=[fake_test, ])
- self.assertTrue("fast/js/not-good.js" in skipped_tests)
-
def test_default_configuration(self):
mock_options = MockOptions()
port = ChromiumPortTest.TestLinuxPort(options=mock_options)
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py (113926 => 113927)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py 2012-04-11 23:46:20 UTC (rev 113926)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py 2012-04-12 00:13:39 UTC (rev 113927)
@@ -357,15 +357,11 @@
return expectations
def skipped_layout_tests(self, test_list):
- # Use a set to allow duplicates
tests_to_skip = set(self._expectations_from_skipped_files(self._skipped_file_search_paths()))
tests_to_skip.update(self._tests_for_other_platforms())
tests_to_skip.update(self._skipped_tests_for_unsupported_features(test_list))
return tests_to_skip
- def skipped_tests(self, test_list):
- return self.skipped_layout_tests(test_list)
-
def _build_path(self, *comps):
# --root is used for running with a pre-built root (like from a nightly zip).
build_directory = self.get_option('root') or self.get_option('build_directory')
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queries.py (113926 => 113927)
--- trunk/Tools/Scripts/webkitpy/tool/commands/queries.py 2012-04-11 23:46:20 UTC (rev 113926)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queries.py 2012-04-12 00:13:39 UTC (rev 113927)
@@ -380,28 +380,6 @@
print crash_logs.find_newest_log(args[0], pid)
-class SkippedPorts(AbstractDeclarativeCommand):
- name = "skipped-ports"
- help_text = "Print the list of ports skipping the given layout test(s)"
- long_help = """Scans the the Skipped file of each port and figure
-out what ports are skipping the test(s). Categories are taken in account too."""
- argument_names = "TEST_NAME"
-
- def execute(self, options, args, tool):
- results = dict([(test_name, []) for test_name in args])
- for port_name in tool.port_factory.all_port_names():
- port_object = tool.port_factory.get(port_name)
- for test_name in args:
- if port_object.skips_layout_test(test_name):
- results[test_name].append(port_name)
-
- for test_name, ports in results.iteritems():
- if ports:
- print "Ports skipping test %r: %s" % (test_name, ', '.join(ports))
- else:
- print "Test %r is not skipped by any port." % test_name
-
-
class PrintExpectations(AbstractDeclarativeCommand):
name = 'print-expectations'
help_text = 'Print the expected result for the given test(s) on the given port(s)'
Modified: trunk/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py (113926 => 113927)
--- trunk/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py 2012-04-11 23:46:20 UTC (rev 113926)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/queries_unittest.py 2012-04-12 00:13:39 UTC (rev 113927)
@@ -91,20 +91,7 @@
expected_stdout = "ok : Builder1\nok : Builder2\n"
self.assert_execute_outputs(TreeStatus(), None, expected_stdout)
- def test_skipped_ports(self):
- tool = MockTool()
- tool.port_factory = MockPortFactory()
- expected_stdout = "Ports skipping test 'media/foo/bar.html': test_port1, test_port2\n"
- self.assert_execute_outputs(SkippedPorts(), ("media/foo/bar.html",), expected_stdout, tool=tool)
-
- expected_stdout = "Ports skipping test 'foo': test_port1\n"
- self.assert_execute_outputs(SkippedPorts(), ("foo",), expected_stdout, tool=tool)
-
- expected_stdout = "Test 'media' is not skipped by any port.\n"
- self.assert_execute_outputs(SkippedPorts(), ("media",), expected_stdout, tool=tool)
-
-
class FailureReasonTest(unittest.TestCase):
def test_blame_line_for_revision(self):
tool = MockTool()