Files
sousa-gecko/testing/web-platform/tests/tools/wpt/update.py
T
Sam Sneddon 385b7fbbd2 Bug 2019148 [wpt PR 58022] - Add support for product plugins to wptrunner/wpt run, a=testonly
Automatic update from web-platform-tests
tools.wpt.browser.Browser doesn't need to be abstract

There's no point in large numbers of subclasses providing no-op
implementations for a lot of these methods; the superclass may as well
do it itself.

--
Remove unneeded overrides from tools.wpt.run.BrowserSetup

setup_kwargs has a clear, obvious no-op implementation, and is
practically required already.

ServoLegacy doesn't need to repeat what it inherits from Servo.

--
tools.wpt doesn't need to lazily import code

Since commit ca1d42c2d55 (June 14, 2017), which introduced the `wpt`
command as a unified entry point, localpaths has been imported at the
module level in tools/wpt/wpt.py before any command modules are loaded.

Therefore, sys.path is guaranteed to include wptrunner and other tools
before tools/wpt/run.py and tools/wpt/update.py are imported.

--
Add docstrings to wptrunner.products

--
Add support for Product plugins to wptrunner

--
Add support for wptrunner plugins to wpt run

--
Add wptrunner.products.Product.add_arguments(argparse.ArgumentParser)

--

wpt-commits: 433f4f09c4753ee5797dae3c4fdd172845b0fe1e, 29c78dada24a6a7026f4867c76599863fe0f576c, 694711874a8636fbe4803ed90072886c64bc7441, eccdc8db528348373312bce8395876950e580c2d, 02eb560ce3f60f9b6a6ba7eb70ee433c38079864, 328e3852856f166aac89f49853a77148aaeaac9e, 378adb7ec1f9536682866e02c70082b1b5cab74a
wpt-pr: 58022
2026-03-23 08:18:37 +00:00

53 lines
1.8 KiB
Python

# mypy: allow-untyped-defs
import os
import sys
from mozlog import commandline
from tools.manifest import manifest
from wptrunner import metadata, wptcommandline
wpt_root = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
def manifest_update(test_paths):
for url_base, paths in test_paths.items():
manifest.load_and_update(
paths.tests_path,
paths.manifest_path,
url_base)
def create_parser_update():
return wptcommandline.create_parser_metadata_update()
def update_expectations(_, **kwargs):
commandline.setup_logging("web-platform-tests",
kwargs,
{"mach": sys.stdout},
formatter_defaults=None)
if not kwargs["tests_root"]:
kwargs["tests_root"] = wpt_root
# This matches the manifest path we end up using in `wpt run`
if not kwargs["manifest_path"]:
kwargs["manifest_path"] = os.path.join(wpt_root, "MANIFEST.json")
kwargs = wptcommandline.check_args_metadata_update(kwargs)
update_properties = metadata.get_properties(properties_file=kwargs["properties_file"],
extra_properties=kwargs["extra_property"],
product=kwargs["product"])
manifest_update(kwargs["test_paths"])
metadata.update_expected(kwargs["test_paths"],
kwargs["run_log"],
update_properties=update_properties,
full_update=False,
disable_intermittent=kwargs["update_intermittent"],
update_intermittent=kwargs["update_intermittent"],
remove_intermittent=kwargs["update_intermittent"])