Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bee9faa82faa4c52bc1c75dbc2f98b02c9d3f3a4
      
https://github.com/WebKit/WebKit/commit/bee9faa82faa4c52bc1c75dbc2f98b02c9d3f3a4
  Author: Sam Sneddon <[email protected]>
  Date:   2024-03-14 (Thu, 14 Mar 2024)

  Changed paths:
    M Tools/Scripts/webkitpy/common/system/filesystem.py
    M Tools/Scripts/webkitpy/common/system/filesystem_mock.py
    A Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py
    M 
Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_legacy.py
    M 
Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_legacy_unittest.py
    A 
Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_unittest.py
    M Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
    M Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
    M Tools/Scripts/webkitpy/port/test.py
    M Tools/Scripts/webkitpy/test/main.py
    M Tools/Scripts/webkitpy/w3c/test_importer_unittest.py

  Log Message:
  -----------
  Rewrite LayoutTestFinder, making it own finding expectations
https://bugs.webkit.org/show_bug.cgi?id=220421
rdar://problem/72894403

Reviewed by Jonathan Bedard.

Previously we have relied on the test runner to probe for expectation
files; this can end up taking a significant amount of time, as it
requires opening the directory file for each item in the baseline search
path, looking for one file at a time. Instead, we should just open each
directory once, when we are finding tests in that directory, and store
the paths to the expected results.

This refactoring also puts us in an easier place to implement
per-directory special-cases for LayoutTestFinder: this is most obviously
useful for making http/wpt and imported/w3c/web-platform-tests more
closely match WPT semantics (and a future patch will move to primarily
relying on the WPT manifest to find tests in these directories, rather
than our existing behaviour).

* Tools/Scripts/webkitpy/common/system/filesystem.py:
(FileSystem):
(FileSystem.dirs_under):
(FileSystem.dirs_under.filter_all):
(FileSystem.files_under):
(FileSystem.islink):
(FileSystem.scandir):
(FileSystem.mkdtemp):
* Tools/Scripts/webkitpy/common/system/filesystem_mock.py:
(MockFileSystem.islink):
(MockFileSystem.scandir):
(ScanDirMock):
(ScanDirMock.__init__):
(ScanDirMock.__iter__):
(ScanDirMock.__enter__):
(ScanDirMock.__exit__):
(ScanDirMock.close):
(DirEntryMock):
(DirEntryMock.__init__):
(DirEntryMock.name):
(DirEntryMock.is_dir):
(DirEntryMock.is_file):
(DirEntryMock.is_symlink):
(DirEntryMock.stat):
(DirEntryMock.inode):
* Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py: Added.
(natsort):
(LayoutTestFinder):
(LayoutTestFinder.__init__):
(LayoutTestFinder._load_w3c_resource_data):
(LayoutTestFinder._canonicalize_test_path):
(LayoutTestFinder.get_tests):
(LayoutTestFinder._split_glob):
(LayoutTestFinder._get_tests_in_directory):
(LayoutTestFinder._process_directory):
(LayoutTestFinder.is_test_file):
(LayoutTestFinder._tests_for_path):
(LayoutTestFinder._find_variants):
(LayoutTestFinder._percent_encoded_variant):
(LayoutTestFinder._is_valid_variant):
(LayoutTestFinder._expectations_for_test):
(LayoutTestFinder.is_wpt_crash_test):
* Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_legacy.py:
(_is_reference_html_file):
(LayoutTestFinder.__init__):
(LayoutTestFinder.find_tests_by_path):
(LayoutTestFinder._is_test_file):
(LayoutTestFinder._is_w3c_resource_file):
(_has_supported_extension): Deleted.
(LayoutTestFinder._is_wpt_test): Deleted.
(LayoutTestFinder._is_wpt_crash_test): Deleted.
(LayoutTestFinder._expand_variants): Deleted.
(LayoutTestFinder._percent_encoded_variant): Deleted.
(LayoutTestFinder._is_valid_variant): Deleted.
(LayoutTestFinder._real_tests): Deleted.
* 
Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_legacy_unittest.py:
(LayoutTestFinderTests.tearDown):
(LayoutTestFinderTests.test_find_glob_b2):
(LayoutTestFinderTests.test_supported_test_extensions): Deleted.
* 
Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder_unittest.py: 
Added.
(LayoutTestFinderTests):
(LayoutTestFinderTests.__init__):
(LayoutTestFinderTests.setUp):
(LayoutTestFinderTests.tearDown):
(LayoutTestFinderTests.test_split_glob):
* Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(_print_expectations):
* Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
(RunTest.test_device_type_specific_listing):
(RunTest.test_ipad_listing):
* Tools/Scripts/webkitpy/port/test.py:
* Tools/Scripts/webkitpy/test/main.py:
(main):
* Tools/Scripts/webkitpy/w3c/test_importer_unittest.py:
(TestImporterTest): Deleted.
(TestImporterTest._parse_options): Deleted.
(TestImporterTest.test_import_dir_with_no_tests_and_no_hg): Deleted.
(TestImporterTest.test_import_dir_with_no_tests): Deleted.
(TestImporterTest.test_import_dir_with_empty_init_py): Deleted.
(TestImporterTest.import_directory): Deleted.
(TestImporterTest.import_downloaded_tests): Deleted.
(TestImporterTest.test_harnesslinks_conversion): Deleted.
(TestImporterTest.test_skip_test_import_download): Deleted.

Canonical link: https://commits.webkit.org/276129@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to