Modified: trunk/Tools/ChangeLog (273834 => 273835)
--- trunk/Tools/ChangeLog 2021-03-03 21:05:25 UTC (rev 273834)
+++ trunk/Tools/ChangeLog 2021-03-03 21:23:08 UTC (rev 273835)
@@ -1,3 +1,15 @@
+2021-03-03 Sam Sneddon <gsnedd...@apple.com>
+
+ Remove LayoutTestFinder.touched_tests, which is now dead code
+ https://bugs.webkit.org/show_bug.cgi?id=222660
+
+ Reviewed by Jonathan Bedard.
+
+ * Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py:
+ (LayoutTestFinder.find_touched_tests): Removed.
+ * Scripts/webkitpy/layout_tests/controllers/layout_test_finder_unittest.py:
+ Remove related tests.
+
2021-03-03 Jonathan Bedard <jbed...@apple.com>
[resultsdbpy] Make testing compatible with Python 3.8
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py (273834 => 273835)
--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py 2021-03-03 21:05:25 UTC (rev 273834)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py 2021-03-03 21:23:08 UTC (rev 273835)
@@ -146,31 +146,6 @@
return True
return False
- def find_touched_tests(self, new_or_modified_paths, apply_skip_expectations=True):
- potential_test_paths = []
- for test_file in new_or_modified_paths:
- if not test_file.startswith(self.LAYOUT_TESTS_DIRECTORY):
- continue
-
- test_file = self._strip_test_dir_prefix(test_file)
- test_paths = self._port.potential_test_names_from_expected_file(test_file)
- if test_paths:
- potential_test_paths.extend(test_paths)
- else:
- potential_test_paths.append(test_file)
-
- if not potential_test_paths:
- return None
-
- tests = self.find_tests_by_path(list(set(potential_test_paths)))
- if not apply_skip_expectations:
- return tests
-
- expectations = test_expectations.TestExpectations(self._port, tests, force_expectations_pass=False)
- expectations.parse_all_expectations()
- tests_to_skip = self.skip_tests(potential_test_paths, tests, expectations, None)
- return [test for test in tests if test not in tests_to_skip]
-
def _strip_test_dir_prefixes(self, paths):
return [self._strip_test_dir_prefix(path) for path in paths if path]
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_unittest.py (273834 => 273835)
--- trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_unittest.py 2021-03-03 21:05:25 UTC (rev 273834)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_unittest.py 2021-03-03 21:23:08 UTC (rev 273835)
@@ -46,15 +46,6 @@
port = TestPort(host)
return LayoutTestFinder(port, None)
- def touched_files(self, touched_files, fs=None):
- host = MockHost()
- if fs:
- host.filesystem = fs
- else:
- fs = host.filesystem
- port = TestPort(host)
- return (fs, MockLayoutTestFinder(port, optparse.Values({'skipped': 'always', 'skip_failing_tests': False, 'http': True})).find_touched_tests(touched_files))
-
def test_supported_test_extensions(self):
self.assertEqual(_supported_test_extensions & Port._supported_reference_extensions, Port._supported_reference_extensions)
@@ -139,45 +130,3 @@
self.assertFalse(finder._is_w3c_resource_file(finder._filesystem, finder._port.layout_tests_dir() + "/imported/w3c/web-platform-tests/XMLHttpRequest", "xmlhttprequest-sync-block-defer-scripts-subframe.html.html"))
self.assertTrue(finder._is_w3c_resource_file(finder._filesystem, finder._port.layout_tests_dir() + "/imported/w3c/web-platform-tests/XMLHttpRequest", "xmlhttprequest-sync-block-defer-scripts-subframe.html"))
self.assertTrue(finder._is_w3c_resource_file(finder._filesystem, finder._port.layout_tests_dir() + "/imported/w3c/web-platform-tests/dom/nodes/Document-createElement-namespace-tests", "test.html"))
-
- def test_touched_test(self):
- paths = ['LayoutTests/test.html', 'LayoutTests/test', 'test2.html', 'Source/test1.html']
- fs, touched_tests = self.touched_files(paths)
- self.assertEqual(touched_tests, ['test.html'])
-
- def test_expected_touched_test(self):
- paths = ['LayoutTests/test-expected.txt', 'LayoutTests/no-test-expected.txt']
- fs = MockFileSystem()
- fs.write_text_file('/test.checkout/LayoutTests/test.html', 'This is a test')
- fs, touched_tests = self.touched_files(paths, fs)
- self.assertEqual(touched_tests, ['test.html'])
-
- def test_platform_expected_touched_test(self):
- paths = ['LayoutTests/platform/mock/test-expected.txt', 'LayoutTests/platform/mock/no-test-expected.txt']
- fs = MockFileSystem()
- fs.write_text_file('/test.checkout/LayoutTests/test.html', 'This is a test')
- fs, touched_tests = self.touched_files(paths, fs)
- self.assertEqual(touched_tests, ['test.html'])
-
- def test_platform_duplicate_touched_test(self):
- paths = ['LayoutTests/test1.html', 'LayoutTests/test1.html', 'LayoutTests/platform/mock1/test2-expected.txt', 'LayoutTests/platform/mock2/test2-expected.txt']
- fs = MockFileSystem()
- fs.write_text_file('/test.checkout/LayoutTests/test2.html', 'This is a test')
- fs, touched_tests = self.touched_files(paths, fs)
- self.assertEqual(sorted(touched_tests), sorted(['test1.html', 'test2.html']))
-
- def test_touched_but_skipped_test(self):
- host = MockHost()
- port = TestPort(host)
-
- expectations_dict = OrderedDict()
- expectations_dict['expectations'] = 'test1.html [ Skip ]\ntest3.html [ Skip ]\n'
- port.expectations_dict = lambda **kwargs: expectations_dict
- port.test_exists = lambda test: True
-
- paths = ['LayoutTests/test0.html', 'LayoutTests/test1.html', 'LayoutTests/test2-expected.txt', 'LayoutTests/test3-expected.txt']
- host.filesystem.write_text_file('/test.checkout/LayoutTests/test2.html', 'This is a test to be runned')
- host.filesystem.write_text_file('/test.checkout/LayoutTests/test3.html', 'This is a test to be skipped')
-
- touched_tests = MockLayoutTestFinder(port, optparse.Values({'skipped': 'always', 'skip_failing_tests': False, 'http': True})).find_touched_tests(paths)
- self.assertEqual(sorted(touched_tests), sorted(['test0.html', 'test2.html']))