From f017169ae482effc446384050e79b752bd9ddfe5 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Sat, 24 Jun 2023 09:22:18 +0200 Subject: [PATCH] Update scripts to reflect new WPT directory name --- etc/unused_wpt_results.py | 6 +++--- etc/wpt_result_analyzer.py | 2 +- python/mach_bootstrap.py | 10 ++-------- python/servo/testing_commands.py | 8 ++++---- python/tidy/tidy.py | 8 ++++---- python/wpt/__init__.py | 2 +- python/wpt/exporter/common.py | 2 +- python/wpt/manifestupdate.py | 2 +- python/wpt/tests/18746.diff | 6 +++--- python/wpt/tests/add-non-utf8-file.diff | 6 +++--- python/wpt/tests/does-not-apply-cleanly.diff | 6 +++--- python/wpt/tests/move-into-wpt.diff | 4 ++-- python/wpt/tests/move-out-of-wpt.diff | 4 ++-- .../{web-platform-tests => tests}/css/css-test.html | 0 .../css/out-of-sync-test.html | 0 .../fetch/api/redirect/redirect-location.html | 0 .../tests/wpt/{web-platform-tests => tests}/test.html | 0 python/wpt/tests/wpt.diff | 6 +++--- servo-tidy.toml | 2 +- tests/wpt/README.md | 8 ++++---- tests/wpt/config.ini | 2 +- 21 files changed, 39 insertions(+), 45 deletions(-) rename python/wpt/tests/servo-mock/tests/wpt/{web-platform-tests => tests}/css/css-test.html (100%) rename python/wpt/tests/servo-mock/tests/wpt/{web-platform-tests => tests}/css/out-of-sync-test.html (100%) rename python/wpt/tests/servo-mock/tests/wpt/{web-platform-tests => tests}/fetch/api/redirect/redirect-location.html (100%) rename python/wpt/tests/servo-mock/tests/wpt/{web-platform-tests => tests}/test.html (100%) diff --git a/etc/unused_wpt_results.py b/etc/unused_wpt_results.py index 31d410cdaa5..25292ac1827 100644 --- a/etc/unused_wpt_results.py +++ b/etc/unused_wpt_results.py @@ -17,7 +17,7 @@ import os -test_root = os.path.join('tests', 'wpt', 'web-platform-tests') +test_root = os.path.join('tests', 'wpt', 'tests') meta_root = os.path.join('tests', 'wpt', 'meta') missing_dirs = [] @@ -37,7 +37,7 @@ for base_dir, dir_names, files in os.walk(meta_root): missing_dirs += [meta_dir] continue - # Turn tests/wpt/meta/foo into tests/wpt/web-platform-tests/foo. + # Turn tests/wpt/meta/foo into tests/wpt/tests/foo. test_dir = os.path.join(test_root, os.path.relpath(meta_dir, meta_root)) if not os.path.exists(test_dir): missing_dirs += [meta_dir] @@ -48,7 +48,7 @@ for base_dir, dir_names, files in os.walk(meta_root): if fname in ['__dir__.ini', 'MANIFEST.json', 'mozilla-sync']: continue - # Turn tests/wpt/meta/foo/bar.html.ini into tests/wpt/web-platform-tests/foo/bar.html. + # Turn tests/wpt/meta/foo/bar.html.ini into tests/wpt/tests/foo/bar.html. test_dir = os.path.join(test_root, os.path.relpath(base_dir, meta_root)) test_file = os.path.join(test_dir, fname) if not os.path.exists(os.path.splitext(test_file)[0]): diff --git a/etc/wpt_result_analyzer.py b/etc/wpt_result_analyzer.py index b9209ea961d..9964304eb53 100644 --- a/etc/wpt_result_analyzer.py +++ b/etc/wpt_result_analyzer.py @@ -20,7 +20,7 @@ import os -test_root = os.path.join('tests', 'wpt', 'web-platform-tests') +test_root = os.path.join('tests', 'wpt', 'tests') meta_root = os.path.join('tests', 'wpt', 'meta') test_counts = {} diff --git a/python/mach_bootstrap.py b/python/mach_bootstrap.py index 2d3d5ce8a4f..448b8d00749 100644 --- a/python/mach_bootstrap.py +++ b/python/mach_bootstrap.py @@ -136,20 +136,14 @@ def wpt_path(is_firefox, topdir, *paths): def wptrunner_path(is_firefox, topdir, *paths): wpt_root = wpt_path(is_firefox, topdir) - if is_firefox: - rel = os.path.join(wpt_root, "tests", "tools", "wptrunner") - else: - rel = os.path.join(wpt_root, "web-platform-tests", "tools", "wptrunner") + rel = os.path.join(wpt_root, "tests", "tools", "wptrunner") return os.path.join(topdir, rel, *paths) def wptserve_path(is_firefox, topdir, *paths): wpt_root = wpt_path(is_firefox, topdir) - if is_firefox: - rel = os.path.join(wpt_root, "tests", "tools", "wptserve") - else: - rel = os.path.join(wpt_root, "web-platform-tests", "tools", "wptserve") + rel = os.path.join(wpt_root, "tests", "tools", "wptserve") return os.path.join(topdir, rel, *paths) diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 1090ec65cab..e91e642605e 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -42,7 +42,7 @@ from distutils.dir_util import copy_tree SCRIPT_PATH = os.path.split(__file__)[0] PROJECT_TOPLEVEL_PATH = os.path.abspath(os.path.join(SCRIPT_PATH, "..", "..")) -WEB_PLATFORM_TESTS_PATH = os.path.join("tests", "wpt", "web-platform-tests") +WEB_PLATFORM_TESTS_PATH = os.path.join("tests", "wpt", "tests") SERVO_TESTS_PATH = os.path.join("tests", "wpt", "mozilla", "tests") CLANGFMT_CPP_DIRS = ["support/hololens/"] @@ -711,14 +711,14 @@ class WebPlatformTestsCreator(CommandBase): if test_url is None: print("""Test path %s is not in wpt directories: -tests/wpt/web-platform-tests for tests that may be shared +tests/wpt/tests for tests that may be shared tests/wpt/mozilla/tests for Servo-only tests""" % test_path) return 1 if reference_url is None: print("""Reference path %s is not in wpt directories: -testing/web-platform/tests for tests that may be shared -testing/web-platform/mozilla/tests for Servo-only tests""" % reference_path) +tests/wpt/tests for tests that may be shared +tests/wpt/mozilla/tests for Servo-only tests""" % reference_path) return 1 if os.path.exists(test_path) and not kwargs["overwrite"]: diff --git a/python/tidy/tidy.py b/python/tidy/tidy.py index e0d09f4a7ea..45e4260ab13 100644 --- a/python/tidy/tidy.py +++ b/python/tidy/tidy.py @@ -25,7 +25,7 @@ from .licenseck import OLD_MPL, MPL, APACHE, COPYRIGHT, licenses_toml, licenses_ TOPDIR = os.path.abspath(os.path.dirname(sys.argv[0])) WPT_PATH = os.path.join(".", "tests", "wpt") -SUITES = ["web-platform-tests", os.path.join("mozilla", "tests")] +SUITES = ["tests", os.path.join("mozilla", "tests")] def wpt_path(*args): @@ -40,7 +40,7 @@ URL_REGEX = re.compile(br'https?://(?:[-\w.]|(?:%[\da-fA-F]{2}))+') # Import wptmanifest only when we do have wpt in tree, i.e. we're not # inside a Firefox checkout. if os.path.isfile(WPT_MANIFEST_PATH): - sys.path.append(wpt_path("web-platform-tests", "tools", "wptrunner", "wptrunner")) + sys.path.append(wpt_path("tests", "tools", "wptrunner", "wptrunner")) from wptmanifest import parser, node # Default configs @@ -506,7 +506,7 @@ def check_manifest_dirs(config_file, print_text=True): print('\rChecking the wpt manifest file...') p = parser.parse(lines) - paths = rec_parse(wpt_path("web-platform-tests"), p) + paths = rec_parse(wpt_path("tests"), p) for idx, path in enumerate(paths): if '_mozilla' in path or '_webgl' in path or '_webgpu' in path: continue @@ -1152,7 +1152,7 @@ class WPTLint(LintRunner): if self.stylo or self.no_wpt: return - wpt_working_dir = os.path.abspath(os.path.join(WPT_PATH, "web-platform-tests")) + wpt_working_dir = os.path.abspath(os.path.join(WPT_PATH, "tests")) for suite in SUITES: files = list(self._get_wpt_files(suite)) if not files: diff --git a/python/wpt/__init__.py b/python/wpt/__init__.py index a8276a506ce..c816a605e73 100644 --- a/python/wpt/__init__.py +++ b/python/wpt/__init__.py @@ -15,7 +15,7 @@ import mozlog.commandline SCRIPT_PATH = os.path.abspath(os.path.dirname(__file__)) SERVO_ROOT = os.path.abspath(os.path.join(SCRIPT_PATH, "..", "..")) WPT_PATH = os.path.join(SERVO_ROOT, "tests", "wpt") -WPT_TOOLS_PATH = os.path.join(WPT_PATH, "web-platform-tests", "tools") +WPT_TOOLS_PATH = os.path.join(WPT_PATH, "tests", "tools") CERTS_PATH = os.path.join(WPT_TOOLS_PATH, "certs") sys.path.insert(0, WPT_TOOLS_PATH) diff --git a/python/wpt/exporter/common.py b/python/wpt/exporter/common.py index 307edce0276..7f2393ac0dc 100644 --- a/python/wpt/exporter/common.py +++ b/python/wpt/exporter/common.py @@ -9,7 +9,7 @@ # pylint: disable=missing-docstring -UPSTREAMABLE_PATH = "tests/wpt/web-platform-tests/" +UPSTREAMABLE_PATH = "tests/wpt/tests/" NO_SYNC_SIGNAL = "[no-wpt-sync]" OPENED_NEW_UPSTREAM_PR = ( diff --git a/python/wpt/manifestupdate.py b/python/wpt/manifestupdate.py index 05d380139db..b382624c7f2 100644 --- a/python/wpt/manifestupdate.py +++ b/python/wpt/manifestupdate.py @@ -34,7 +34,7 @@ def create_parser(): def update(check_clean=True, rebuild=False, **kwargs): logger = wptlogging.setup(kwargs, {"mach": sys.stdout}) kwargs = {"config": os.path.join(WPT_PATH, "config.ini"), - "manifest_path": os.path.join(WPT_PATH, "metadata"), + "manifest_path": os.path.join(WPT_PATH, "meta"), "tests_root": None, "metadata_root": None} diff --git a/python/wpt/tests/18746.diff b/python/wpt/tests/18746.diff index ad6150c1bdb..61997053969 100644 --- a/python/wpt/tests/18746.diff +++ b/python/wpt/tests/18746.diff @@ -1,7 +1,7 @@ -diff --git a/tests/wpt/web-platform-tests/fetch/api/redirect/redirect-location.html b/tests/wpt/web-platform-tests/fetch/api/redirect/redirect-location.html +diff --git a/tests/wpt/tests/fetch/api/redirect/redirect-location.html b/tests/wpt/tests/fetch/api/redirect/redirect-location.html index ac35dea54c47..135ad21d15ab 100644 ---- a/tests/wpt/web-platform-tests/fetch/api/redirect/redirect-location.html -+++ b/tests/wpt/web-platform-tests/fetch/api/redirect/redirect-location.html +--- a/tests/wpt/tests/fetch/api/redirect/redirect-location.html ++++ b/tests/wpt/tests/fetch/api/redirect/redirect-location.html @@ -13,4 +13,5 @@ diff --git a/python/wpt/tests/add-non-utf8-file.diff b/python/wpt/tests/add-non-utf8-file.diff index bd3b755d87d..5a6a684924d 100644 --- a/python/wpt/tests/add-non-utf8-file.diff +++ b/python/wpt/tests/add-non-utf8-file.diff @@ -1,7 +1,7 @@ -diff --git a/tests/wpt/web-platform-tests/non-utf8-file.txt b/tests/wpt/web-platform-tests/non-utf8-file.txt +diff --git a/tests/wpt/tests/non-utf8-file.txt b/tests/wpt/tests/non-utf8-file.txt new file mode 100644 index 0000000..5a992e0 --- /dev/null -+++ b/tests/wpt/web-platform-tests/non-utf8-file.txt ++++ b/tests/wpt/tests/non-utf8-file.txt @@ -0,0 +1 @@ -+foo bér ÿ " ++foo bér � " diff --git a/python/wpt/tests/does-not-apply-cleanly.diff b/python/wpt/tests/does-not-apply-cleanly.diff index aa49c3bafbe..904b4ed859d 100644 --- a/python/wpt/tests/does-not-apply-cleanly.diff +++ b/python/wpt/tests/does-not-apply-cleanly.diff @@ -1,7 +1,7 @@ -diff --git a/tests/wpt/web-platform-tests/css/css-test.html b/tests/wpt/web-platform-tests/css/css-test.html +diff --git a/tests/wpt/tests/css/css-test.html b/tests/wpt/tests/css/css-test.html index cffb6eb..6100a49 100644 ---- a/tests/wpt/web-platform-tests/css/out-of-sync-test.html -+++ b/tests/wpt/web-platform-tests/css/out-of-sync-test.html +--- a/tests/wpt/tests/css/out-of-sync-test.html ++++ b/tests/wpt/tests/css/out-of-sync-test.html @@ -1,3 +1,3 @@ -

css test!

diff --git a/python/wpt/tests/move-into-wpt.diff b/python/wpt/tests/move-into-wpt.diff index 02c437cdd7b..4e5656fc0f9 100644 --- a/python/wpt/tests/move-into-wpt.diff +++ b/python/wpt/tests/move-into-wpt.diff @@ -1,4 +1,4 @@ -diff --git a/tests/wpt/mozilla/tests/mozilla/mozilla-test.html b/tests/wpt/web-platform-tests/mozilla-test.html +diff --git a/tests/wpt/mozilla/tests/mozilla/mozilla-test.html b/tests/wpt/tests/mozilla-test.html similarity index 100% rename from tests/wpt/mozilla/tests/mozilla/mozilla-test.html -rename to tests/wpt/web-platform-tests/mozilla-test.html +rename to tests/wpt/tests/mozilla-test.html diff --git a/python/wpt/tests/move-out-of-wpt.diff b/python/wpt/tests/move-out-of-wpt.diff index f81541363ec..0b0d834c437 100644 --- a/python/wpt/tests/move-out-of-wpt.diff +++ b/python/wpt/tests/move-out-of-wpt.diff @@ -1,4 +1,4 @@ -diff --git a/tests/wpt/web-platform-tests/test.html b/tests/wpt/test.html +diff --git a/tests/wpt/tests/test.html b/tests/wpt/test.html similarity index 100% -rename from tests/wpt/web-platform-tests/test.html +rename from tests/wpt/tests/test.html rename to tests/wpt/test.html diff --git a/python/wpt/tests/servo-mock/tests/wpt/web-platform-tests/css/css-test.html b/python/wpt/tests/servo-mock/tests/wpt/tests/css/css-test.html similarity index 100% rename from python/wpt/tests/servo-mock/tests/wpt/web-platform-tests/css/css-test.html rename to python/wpt/tests/servo-mock/tests/wpt/tests/css/css-test.html diff --git a/python/wpt/tests/servo-mock/tests/wpt/web-platform-tests/css/out-of-sync-test.html b/python/wpt/tests/servo-mock/tests/wpt/tests/css/out-of-sync-test.html similarity index 100% rename from python/wpt/tests/servo-mock/tests/wpt/web-platform-tests/css/out-of-sync-test.html rename to python/wpt/tests/servo-mock/tests/wpt/tests/css/out-of-sync-test.html diff --git a/python/wpt/tests/servo-mock/tests/wpt/web-platform-tests/fetch/api/redirect/redirect-location.html b/python/wpt/tests/servo-mock/tests/wpt/tests/fetch/api/redirect/redirect-location.html similarity index 100% rename from python/wpt/tests/servo-mock/tests/wpt/web-platform-tests/fetch/api/redirect/redirect-location.html rename to python/wpt/tests/servo-mock/tests/wpt/tests/fetch/api/redirect/redirect-location.html diff --git a/python/wpt/tests/servo-mock/tests/wpt/web-platform-tests/test.html b/python/wpt/tests/servo-mock/tests/wpt/tests/test.html similarity index 100% rename from python/wpt/tests/servo-mock/tests/wpt/web-platform-tests/test.html rename to python/wpt/tests/servo-mock/tests/wpt/tests/test.html diff --git a/python/wpt/tests/wpt.diff b/python/wpt/tests/wpt.diff index 37781cf488e..5bbbd74ee5e 100644 --- a/python/wpt/tests/wpt.diff +++ b/python/wpt/tests/wpt.diff @@ -1,7 +1,7 @@ -diff --git a/tests/wpt/web-platform-tests/css/css-test.html b/tests/wpt/web-platform-tests/css/css-test.html +diff --git a/tests/wpt/tests/css/css-test.html b/tests/wpt/tests/css/css-test.html index cffb6eb..6100a49 100644 ---- a/tests/wpt/web-platform-tests/css/css-test.html -+++ b/tests/wpt/web-platform-tests/css/css-test.html +--- a/tests/wpt/tests/css/css-test.html ++++ b/tests/wpt/tests/css/css-test.html @@ -1,3 +1,3 @@ -

css test!

diff --git a/servo-tidy.toml b/servo-tidy.toml index 9de03263305..1792ef74b3c 100644 --- a/servo-tidy.toml +++ b/servo-tidy.toml @@ -133,7 +133,7 @@ directories = [ "./support/android/apk", "./support/hololens", "./tests/wpt/harness", - "./tests/wpt/web-platform-tests", + "./tests/wpt/tests", "./tests/wpt/mozilla/tests/mozilla/referrer-policy", "./tests/wpt/mozilla/tests/webgl", "./python/tidy/tests", diff --git a/tests/wpt/README.md b/tests/wpt/README.md index d7f15f7c78a..d2d4d557129 100644 --- a/tests/wpt/README.md +++ b/tests/wpt/README.md @@ -9,7 +9,7 @@ In particular, this folder contains: * `config.ini`: some configuration for the web-platform-tests. * `include.ini`: the subset of web-platform-tests we currently run. -* `web-platform-tests`: copy of the web-platform-tests. +* `tests`: copy of the web-platform-tests. * `meta`: expected failures for the web-platform-tests we run. * `mozilla`: web-platform-tests that cannot be upstreamed. @@ -24,7 +24,7 @@ stdout. A subset of tests may be run by providing positional arguments to the mach command, either as filesystem paths or as test urls e.g. - ./mach test-wpt tests/wpt/web-platform-tests/dom/historical.html + ./mach test-wpt tests/wpt/tests/dom/historical.html to run the dom/historical.html test, or @@ -59,8 +59,8 @@ can only run one WPT server at a time. To fix this: 1. Follow the steps in [**Running the tests manually**](#running-the-tests-manually) 2. Add a `break` to [start_servers in serve.py](https://github.com/servo/servo/blob/ce92b7bfbd5855aac18cb4f8a8ec59048041712e/tests/wpt/web-platform-tests/tools/serve/serve.py#L745-L783) as follows: ``` - --- a/tests/wpt/web-platform-tests/tools/serve/serve.py - +++ b/tests/wpt/web-platform-tests/tools/serve/serve.py + --- a/tests/wpt/tests/tools/serve/serve.py + +++ b/tests/wpt/tests/tools/serve/serve.py @@ -746,6 +746,7 @@ def start_servers(logger, host, ports, paths, routes, bind_address, config, mp_context, log_handlers, **kwargs): servers = defaultdict(list) diff --git a/tests/wpt/config.ini b/tests/wpt/config.ini index 192253939a4..c6703452ddc 100644 --- a/tests/wpt/config.ini +++ b/tests/wpt/config.ini @@ -12,7 +12,7 @@ sync_path = sync run-info = . [manifest:upstream] -tests = web-platform-tests +tests = tests metadata = meta url-base = /