Changeset 232746 in webkit


Ignore:
Timestamp:
Jun 12, 2018 12:55:42 AM (6 years ago)
Author:
zandobersek@gmail.com
Message:

Add run-web-platform-tests script
https://bugs.webkit.org/show_bug.cgi?id=183356

Reviewed by Carlos Alberto Lopez Perez.

.:

Store port-specific test expectations and test manifest files for the
web-platform-tests test runs under the top-level WebPlatformTests
directory.

TestExpectations.json file lists all the failing or disabled tests
or subtests that are to be expected in the test run. This information is
parsed in the run-web-platform-tests script and used to build
test-specific metadata files (ending with .ini) inside a temporary
directory that is then used during the test run. JSON format is used to
follow the WebDriver test suite in how it manages expectations, and to
avoid having to manually manage .ini files for every deviant test case.

TestManifest.ini file is used to fine-tune which tests are to be enabled
by default. For the GTK+ port, we currently disable all tests by default
but then specifically enable tests under the 2dcontext and WebCryptoAPI
directories. This will allow for gradual enabling of further tests.

  • WebPlatformTests/gtk/TestExpectations.json: Added.
  • WebPlatformTests/gtk/TestManifest.ini: Added.

Tools:

Add the run-web-platform-tests script that allows running WebKit builds
against the external web-platform-tests project.

The script sets up all the port-specific information, including the
display driver. If no web-platform-tests repository location is
specified, the TestDownloader utility is used to clone the repository,
and path to that clone is leveraged instead.

Port-specific TestManifest.ini and TestExpectations.json file paths are
then constructed, bailing if any of the files is missing. The JSON file
is then used to construct the metadata file tree, creating an .ini file
for each test that is disabled, has a certain expectation, or has
subtests that themselves have certain expectations. This metadata tree
is built under the build directory, and is purged and reconstructed for
each separate run.

Lastly, the WPT python module is imported from the web-platform-tests
source location, and wpt.main() is invoked along with all the necessary
arguments that set up a web-platform-tests suite run using the WebKit
product.

  • Scripts/run-web-platform-tests: Added.
  • Scripts/webkitpy/common/config/ports_mock.py:

(MockPort.run_bindings_tests_command):
(MockPort):
(MockPort.wpt_metadata_directory):
(MockPort.wpt_manifest_file):

  • Scripts/webkitpy/port/base.py:

(Port.wpt_metadata_directory):
(Port):
(Port.wpt_manifest_file):

  • Scripts/webkitpy/w3c/common.py:

(is_file_exportable):
(WPTPaths):
(WPTPaths.checkout_directory):
(WPTPaths.wpt_checkout_path):

  • Scripts/webkitpy/w3c/test_downloader.py:

(TestDownloader.clone_tests):
(TestDownloader):
(TestDownloader.download_tests):

  • Scripts/webkitpy/w3c/test_exporter.py:

(WebPlatformTestExporter.init):

  • Scripts/webkitpy/w3c/wpt_runner.py: Added.

(main):
(parse_args):
(create_webdriver):
(spawn_wpt):
(WPTRunner):
(WPTRunner.init):
(WPTRunner._prepare_wpt_checkout):
(WPTRunner._generate_metadata_directory):
(WPTRunner.run):

  • Scripts/webkitpy/w3c/wpt_runner_unittest.py: Added.

(WPTRunnerTest):
(WPTRunnerTest.MockTestDownloader):
(WPTRunnerTest.MockTestDownloader.default_options):
(WPTRunnerTest.MockTestDownloader.init):
(WPTRunnerTest.MockTestDownloader.clone_tests):
(WPTRunnerTest.MockWebDriver):
(WPTRunnerTest.MockWebDriver.create):
(WPTRunnerTest.MockWebDriver.binary_path):
(WPTRunnerTest.MockWebDriver.browser_path):
(WPTRunnerTest.MockWebDriver.browser_args):
(WPTRunnerTest.MockSpawnWPT):
(WPTRunnerTest.MockSpawnWPT.init):
(WPTRunnerTest.MockSpawnWPT.call):
(WPTRunnerTest.TestInstance):
(WPTRunnerTest.TestInstance.init):
(WPTRunnerTest.TestInstance.prepare_mock_files_for_run):
(WPTRunnerTest.test_prepare_wpt_checkout):
(WPTRunnerTest.test_prepare_wpt_checkout_specified_path):
(WPTRunnerTest.test_generate_metadata_directory):
(WPTRunnerTest.test_run):
(WPTRunnerTest.test_run_with_specified_options):
(WPTRunnerTest.test_run_with_args):

Location:
trunk
Files:
7 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r232744 r232746  
     12018-06-12  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        Add run-web-platform-tests script
     4        https://bugs.webkit.org/show_bug.cgi?id=183356
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        Store port-specific test expectations and test manifest files for the
     9        web-platform-tests test runs under the top-level WebPlatformTests
     10        directory.
     11
     12        TestExpectations.json file lists all the failing or disabled tests
     13        or subtests that are to be expected in the test run. This information is
     14        parsed in the run-web-platform-tests script and used to build
     15        test-specific metadata files (ending with .ini) inside a temporary
     16        directory that is then used during the test run. JSON format is used to
     17        follow the WebDriver test suite in how it manages expectations, and to
     18        avoid having to manually manage .ini files for every deviant test case.
     19
     20        TestManifest.ini file is used to fine-tune which tests are to be enabled
     21        by default. For the GTK+ port, we currently disable all tests by default
     22        but then specifically enable tests under the 2dcontext and WebCryptoAPI
     23        directories. This will allow for gradual enabling of further tests.
     24
     25        * WebPlatformTests/gtk/TestExpectations.json: Added.
     26        * WebPlatformTests/gtk/TestManifest.ini: Added.
     27
    1282018-06-11  Carlos Garcia Campos  <cgarcia@igalia.com>
    229
  • trunk/Tools/ChangeLog

    r232733 r232746  
     12018-06-12  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        Add run-web-platform-tests script
     4        https://bugs.webkit.org/show_bug.cgi?id=183356
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        Add the run-web-platform-tests script that allows running WebKit builds
     9        against the external web-platform-tests project.
     10
     11        The script sets up all the port-specific information, including the
     12        display driver. If no web-platform-tests repository location is
     13        specified, the TestDownloader utility is used to clone the repository,
     14        and path to that clone is leveraged instead.
     15
     16        Port-specific TestManifest.ini and TestExpectations.json file paths are
     17        then constructed, bailing if any of the files is missing. The JSON file
     18        is then used to construct the metadata file tree, creating an .ini file
     19        for each test that is disabled, has a certain expectation, or has
     20        subtests that themselves have certain expectations. This metadata tree
     21        is built under the build directory, and is purged and reconstructed for
     22        each separate run.
     23
     24        Lastly, the WPT python module is imported from the web-platform-tests
     25        source location, and wpt.main() is invoked along with all the necessary
     26        arguments that set up a web-platform-tests suite run using the WebKit
     27        product.
     28
     29        * Scripts/run-web-platform-tests: Added.
     30        * Scripts/webkitpy/common/config/ports_mock.py:
     31        (MockPort.run_bindings_tests_command):
     32        (MockPort):
     33        (MockPort.wpt_metadata_directory):
     34        (MockPort.wpt_manifest_file):
     35        * Scripts/webkitpy/port/base.py:
     36        (Port.wpt_metadata_directory):
     37        (Port):
     38        (Port.wpt_manifest_file):
     39        * Scripts/webkitpy/w3c/common.py:
     40        (is_file_exportable):
     41        (WPTPaths):
     42        (WPTPaths.checkout_directory):
     43        (WPTPaths.wpt_checkout_path):
     44        * Scripts/webkitpy/w3c/test_downloader.py:
     45        (TestDownloader.clone_tests):
     46        (TestDownloader):
     47        (TestDownloader.download_tests):
     48        * Scripts/webkitpy/w3c/test_exporter.py:
     49        (WebPlatformTestExporter.__init__):
     50        * Scripts/webkitpy/w3c/wpt_runner.py: Added.
     51        (main):
     52        (parse_args):
     53        (create_webdriver):
     54        (spawn_wpt):
     55        (WPTRunner):
     56        (WPTRunner.__init__):
     57        (WPTRunner._prepare_wpt_checkout):
     58        (WPTRunner._generate_metadata_directory):
     59        (WPTRunner.run):
     60        * Scripts/webkitpy/w3c/wpt_runner_unittest.py: Added.
     61        (WPTRunnerTest):
     62        (WPTRunnerTest.MockTestDownloader):
     63        (WPTRunnerTest.MockTestDownloader.default_options):
     64        (WPTRunnerTest.MockTestDownloader.__init__):
     65        (WPTRunnerTest.MockTestDownloader.clone_tests):
     66        (WPTRunnerTest.MockWebDriver):
     67        (WPTRunnerTest.MockWebDriver.create):
     68        (WPTRunnerTest.MockWebDriver.binary_path):
     69        (WPTRunnerTest.MockWebDriver.browser_path):
     70        (WPTRunnerTest.MockWebDriver.browser_args):
     71        (WPTRunnerTest.MockSpawnWPT):
     72        (WPTRunnerTest.MockSpawnWPT.__init__):
     73        (WPTRunnerTest.MockSpawnWPT.__call__):
     74        (WPTRunnerTest.TestInstance):
     75        (WPTRunnerTest.TestInstance.__init__):
     76        (WPTRunnerTest.TestInstance.prepare_mock_files_for_run):
     77        (WPTRunnerTest.test_prepare_wpt_checkout):
     78        (WPTRunnerTest.test_prepare_wpt_checkout_specified_path):
     79        (WPTRunnerTest.test_generate_metadata_directory):
     80        (WPTRunnerTest.test_run):
     81        (WPTRunnerTest.test_run_with_specified_options):
     82        (WPTRunnerTest.test_run_with_args):
     83
    1842018-06-11  Mark Lam  <mark.lam@apple.com>
    285
  • trunk/Tools/Scripts/webkitpy/common/config/ports_mock.py

    r212579 r232746  
    5959    def run_bindings_tests_command(self):
    6060        return ['mock-run-bindings-tests']
     61
     62    def wpt_metadata_directory(self):
     63        return '/mock-path/mock-wpt-tests-metadata'
     64
     65    def wpt_manifest_file(self):
     66        return '/mock-path/mock-wpt-manifest.json'
  • trunk/Tools/Scripts/webkitpy/port/base.py

    r232711 r232746  
    872872        return self._build_path('layout-test-results')
    873873
     874    def wpt_metadata_directory(self):
     875        return self._build_path('web-platform-tests-metadata')
     876
     877    def wpt_manifest_file(self):
     878        return self._build_path('web-platform-tests-manifest.json')
     879
    874880    def setup_test_run(self, device_class=None):
    875881        """Perform port-specific work at the beginning of a test run."""
  • trunk/Tools/Scripts/webkitpy/w3c/common.py

    r232389 r232746  
    9999    basename = path[path.rfind('/') + 1:]
    100100    return not is_basename_skipped(basename)
     101
     102
     103class WPTPaths:
     104    CHECKOUT_DIRECTORY = ["WebKitBuild", "w3c-tests"]
     105    WPT_CHECKOUT_PATH = CHECKOUT_DIRECTORY + ["web-platform-tests"]
     106
     107    @staticmethod
     108    def checkout_directory(finder):
     109        return finder.path_from_webkit_base(*WPTPaths.CHECKOUT_DIRECTORY)
     110
     111    @staticmethod
     112    def wpt_checkout_path(finder):
     113        return finder.path_from_webkit_base(*WPTPaths.WPT_CHECKOUT_PATH)
  • trunk/Tools/Scripts/webkitpy/w3c/test_downloader.py

    r215670 r232746  
    220220        self._filesystem.write_text_file(self._filesystem.join(destination_directory, test_repository['name'], '.gitignore'), '\n'.join(rules))
    221221
    222     def download_tests(self, destination_directory, test_paths=[], use_tip_of_tree=False):
     222    def clone_tests(self, use_tip_of_tree=False):
    223223        for test_repository in self.test_repositories:
    224224            self.checkout_test_repository(test_repository['revision'] if not use_tip_of_tree else 'origin/master', test_repository['url'], self._filesystem.join(self.repository_directory, test_repository['name']))
     225
     226    def download_tests(self, destination_directory, test_paths=[], use_tip_of_tree=False):
     227        self.clone_tests(use_tip_of_tree)
    225228        self.copy_tests(destination_directory, test_paths)
  • trunk/Tools/Scripts/webkitpy/w3c/test_exporter.py

    r232398 r232746  
    3838from webkitpy.w3c.wpt_github import WPTGitHub
    3939from webkitpy.w3c.wpt_linter import WPTLinter
    40 from webkitpy.w3c.common import WPT_GH_ORG, WPT_GH_REPO_NAME, WPT_GH_URL
     40from webkitpy.w3c.common import WPT_GH_ORG, WPT_GH_REPO_NAME, WPT_GH_URL, WPTPaths
    4141from webkitpy.common.memoized import memoized
    4242
     
    7070        if not self._options.repository_directory:
    7171            webkit_finder = WebKitFinder(self._filesystem)
    72             self._options.repository_directory = webkit_finder.path_from_webkit_base('WebKitBuild', 'w3c-tests', 'web-platform-tests')
     72            self._options.repository_directory = WPTPaths.wpt_checkout_path(webkit_finder)
    7373
    7474        self._linter = WPTLinterClass(self._options.repository_directory, host.filesystem)
Note: See TracChangeset for help on using the changeset viewer.