mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
Update web-platform-tests to revision 122a4672fa0dc554a6e7528fa3487fd907c792ee
This commit is contained in:
parent
fb1123495f
commit
93d826f7ba
301 changed files with 4775 additions and 1769 deletions
|
@ -1,14 +1,14 @@
|
|||
import requests
|
||||
from mozlog.structured.formatters.base import BaseFormatter
|
||||
|
||||
DEFAULT_API = "https://wpt.fyi/api/screenshots/hashes"
|
||||
|
||||
|
||||
class WptscreenshotFormatter(BaseFormatter):
|
||||
"""Formatter that outputs screenshots in the format expected by wpt.fyi."""
|
||||
|
||||
# TODO(Hexcles): Make this configurable.
|
||||
API = "https://staging.wpt.fyi/api/screenshots/hashes"
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, api=None):
|
||||
self.api = api or DEFAULT_API
|
||||
self.cache = set()
|
||||
|
||||
def suite_start(self, data):
|
||||
|
@ -25,7 +25,7 @@ class WptscreenshotFormatter(BaseFormatter):
|
|||
if "os_version" in run_info:
|
||||
params["os_version"] = run_info["os_version"]
|
||||
try:
|
||||
r = requests.get(self.API, params=params)
|
||||
r = requests.get(self.api, params=params)
|
||||
r.raise_for_status()
|
||||
self.cache = set(r.json())
|
||||
except (requests.exceptions.RequestException, ValueError):
|
||||
|
|
|
@ -325,6 +325,14 @@ scheme host and port.""")
|
|||
help="List of URLs for tests to run, or paths including tests to run. "
|
||||
"(equivalent to --include)")
|
||||
|
||||
def screenshot_api_wrapper(formatter, api):
|
||||
formatter.api = api
|
||||
return formatter
|
||||
|
||||
commandline.fmt_options["api"] = (screenshot_api_wrapper,
|
||||
"Cache API (default: %s)" % wptscreenshot.DEFAULT_API,
|
||||
{"wptscreenshot"}, "store")
|
||||
|
||||
commandline.log_formatters["chromium"] = (chromium.ChromiumFormatter, "Chromium Layout Tests format")
|
||||
commandline.log_formatters["wptreport"] = (wptreport.WptreportFormatter, "wptreport format")
|
||||
commandline.log_formatters["wptscreenshot"] = (wptscreenshot.WptscreenshotFormatter, "wpt.fyi screenshots")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue