Update web-platform-tests to revision bc60e6f82132cfc9a5b688c566c7772024b3c15c

This commit is contained in:
WPT Sync Bot 2019-07-26 10:25:50 +00:00
parent 449881f566
commit 29156ca9e2
223 changed files with 7517 additions and 2093 deletions

View file

@ -155,6 +155,9 @@ An example of an expectation file is::
if platform == 'osx': ERROR
FAIL
[subtest3]
expected: [PASS, TIMEOUT]
[filename.html?query=something]
disabled: bug12345
@ -222,7 +225,9 @@ The web-platform-test harness knows about several keys:
`expected`
Must evaluate to a possible test status indicating the expected
result of the test. The implicit default is PASS or OK when the
field isn't present.
field isn't present. When `expected` is a list, the first status
is the primary expected status and the trailing statuses listed are
expected intermittent statuses.
`disabled`
Any value indicates that the test is disabled.

View file

@ -98,6 +98,25 @@ wptupdate takes several useful options:
Overwrite all the expectation data for any tests that have a result
in the passed log files, not just data for the same platform.
``--disable-intermittent``
When updating test results, disable tests that have inconsistent
results across many runs. This can precede a message providing a
reason why that test is disable. If no message is provided,
``unstable`` is the default text.
``--update-intermittent``
When this option is used, the ``expected`` key (see below) stores
expected intermittent statuses in addition to the primary expected
status. If there is more than one status, it appears as a list. The
default behaviour of this option is to retain any existing intermittent
statuses in the list unless ``--remove-intermittent`` is specified.
``--remove-intermittent``
This option is used in conjunction with ``--update-intermittent``.
When the ``expected`` statuses are updated, any obsolete intermittent
statuses that did not occur in the specified logfiles are removed from
the list.
Examples
~~~~~~~~
@ -190,7 +209,8 @@ When used for expectation data, manifests have the following format:
* A subsection per subtest, with the heading being the title of the
subtest.
* A key ``expected`` giving the expectation value of each (sub)test.
* A key ``expected`` giving the expectation value or values of each
(sub)test.
* A key ``disabled`` which can be set to any value to indicate that
the (sub)test is disabled and should either not be run (for tests)
@ -236,6 +256,9 @@ An simple example manifest might look like::
[Test something unsupported]
expected: FAIL
[Test with intermittent statuses]
expected: [PASS, TIMEOUT]
[test.html?variant=broken]
expected: ERROR

View file

@ -2,7 +2,7 @@ html5lib==1.0.1
mozinfo==1.1.0
mozlog==4.2.0
mozdebug==0.1.1
pillow==6.0.0
pillow==6.1.0
urllib3[secure]==1.25.3
requests==2.22.0
six==1.12.0

View file

@ -160,7 +160,7 @@ def run_info_extras(**kwargs):
rv = {"e10s": kwargs["gecko_e10s"],
"wasm": kwargs.get("wasm", True),
"verify": kwargs["verify"],
"headless": "MOZ_HEADLESS" in os.environ,
"headless": kwargs.get("headless", False) or "MOZ_HEADLESS" in os.environ,
"fission": get_bool_pref("fission.autostart"),
"sw-e10s": get_bool_pref("dom.serviceWorkers.parent_intercept")}
rv.update(run_info_browser_version(kwargs["binary"]))

View file

@ -1,13 +1,10 @@
import os
import tempfile
import moznetwork
from mozprocess import ProcessHandler
from mozprofile import FirefoxProfile
from mozrunner import FennecEmulatorRunner
from tools.serve.serve import make_hosts_file
from .base import (get_free_port,
cmd_arg,
browser_command)
@ -34,7 +31,6 @@ __wptrunner__ = {"product": "firefox_android",
"timeout_multiplier": "get_timeout_multiplier"}
def check_args(**kwargs):
pass
@ -85,21 +81,6 @@ def env_options():
"supports_debugger": True}
def write_hosts_file(config, device):
new_hosts = make_hosts_file(config, moznetwork.get_ip())
current_hosts = device.get_file("/etc/hosts")
if new_hosts == current_hosts:
return
hosts_fd, hosts_path = tempfile.mkstemp()
try:
with os.fdopen(hosts_fd, "w") as f:
f.write(new_hosts)
device.remount()
device.push(hosts_path, "/etc/hosts")
finally:
os.remove(hosts_path)
class FirefoxAndroidBrowser(FirefoxBrowser):
init_timeout = 300
shutdown_timeout = 60
@ -132,22 +113,28 @@ class FirefoxAndroidBrowser(FirefoxBrowser):
preferences = self.load_prefs()
self.profile = FirefoxProfile(preferences=preferences)
self.profile.set_preferences({"marionette.port": self.marionette_port,
"dom.disable_open_during_load": False,
"places.history.enabled": False,
"dom.send_after_paint_to_content": True,
"network.preload": True})
self.profile.set_preferences({
"marionette.port": self.marionette_port,
"network.dns.localDomains": ",".join(self.config.domains_set),
"dom.disable_open_during_load": False,
"places.history.enabled": False,
"dom.send_after_paint_to_content": True,
"network.preload": True,
})
if self.test_type == "reftest":
self.logger.info("Setting android reftest preferences")
self.profile.set_preferences({"browser.viewport.desktopWidth": 800,
# Disable high DPI
"layout.css.devPixelsPerPx": "1.0",
# Ensure that the full browser element
# appears in the screenshot
"apz.allow_zooming": False,
"android.widget_paints_background": False,
# Ensure that scrollbars are always painted
"layout.testing.overlay-scrollbars.always-visible": True})
self.profile.set_preferences({
"browser.viewport.desktopWidth": 800,
# Disable high DPI
"layout.css.devPixelsPerPx": "1.0",
# Ensure that the full browser element
# appears in the screenshot
"apz.allow_zooming": False,
"android.widget_paints_background": False,
# Ensure that scrollbars are always painted
"layout.testing.overlay-scrollbars.always-visible": True,
})
if self.install_fonts:
self.logger.debug("Copying Ahem font to profile")
@ -189,26 +176,30 @@ class FirefoxAndroidBrowser(FirefoxBrowser):
# connect to a running emulator
self.runner.device.connect()
write_hosts_file(self.config, self.runner.device.device)
self.runner.stop()
self.runner.start(debug_args=debug_args, interactive=self.debug_info and self.debug_info.interactive)
self.runner.start(debug_args=debug_args,
interactive=self.debug_info and self.debug_info.interactive)
self.runner.device.device.forward(
local="tcp:{}".format(self.marionette_port),
remote="tcp:{}".format(self.marionette_port))
for ports in self.config.ports.values():
for port in ports:
self.runner.device.device.reverse(
local="tcp:{}".format(port),
remote="tcp:{}".format(port))
self.logger.debug("%s Started" % self.package_name)
def stop(self, force=False):
if self.runner is not None:
if (self.runner.device.connected and
len(self.runner.device.device.list_forwards()) > 0):
if self.runner.device.connected:
try:
self.runner.device.device.remove_forwards(
"tcp:{}".format(self.marionette_port))
except Exception:
self.logger.warning("Failed to remove port forwarding")
self.runner.device.device.remove_forwards()
self.runner.device.device.remove_reverses()
except Exception as e:
self.logger.warning("Failed to remove forwarded or reversed ports: %s" % e)
# We assume that stopping the runner prompts the
# browser to shut down. This allows the leak log to be written
self.runner.stop()

View file

@ -14,7 +14,7 @@ here = os.path.split(__file__)[0]
repo_root = os.path.abspath(os.path.join(here, os.pardir, os.pardir, os.pardir))
sys.path.insert(0, repo_root)
from tools import localpaths # noqa: flake8
from tools import localpaths # noqa: F401
from wptserve.handlers import StringHandler

View file

@ -104,6 +104,8 @@ class WptreportFormatter(BaseFormatter):
subtest["status"] = data["status"]
if "expected" in data:
subtest["expected"] = data["expected"]
if "known_intermittent" in data:
subtest["known_intermittent"] = data["known_intermittent"]
if "message" in data:
subtest["message"] = replace_lone_surrogate(data["message"])
@ -114,6 +116,8 @@ class WptreportFormatter(BaseFormatter):
test["status"] = data["status"]
if "expected" in data:
test["expected"] = data["expected"]
if "known_intermittent" in data:
test["known_intermittent"] = data["known_intermittent"]
if "message" in data:
test["message"] = replace_lone_surrogate(data["message"])
if "reftest_screenshots" in data.get("extra", {}):

View file

@ -104,7 +104,9 @@ def test_wptreport_lone_surrogate_ucs2(capfd):
logger = structuredlog.StructuredLogger("test_a")
logger.add_handler(handlers.StreamHandler(output, WptreportFormatter()))
with mock.patch.object(wptreport, 'surrogate_replacement', wptreport.SurrogateReplacementUcs2()):
with mock.patch.object(wptreport,
'surrogate_replacement',
wptreport.SurrogateReplacementUcs2()):
# output a bunch of stuff
logger.suite_start(["test-id-1"]) # no run_info arg!
logger.test_start("test-id-1")
@ -131,3 +133,36 @@ def test_wptreport_lone_surrogate_ucs2(capfd):
subtest = test["subtests"][0]
assert subtest["name"] == u"Name with surrogateU+d800"
assert subtest["message"] == u"\U0001F601 U+de0aU+d83d \U0001f60a"
def test_wptreport_known_intermittent(capfd):
output = StringIO()
logger = structuredlog.StructuredLogger("test_a")
logger.add_handler(handlers.StreamHandler(output, WptreportFormatter()))
# output a bunch of stuff
logger.suite_start(["test-id-1"]) # no run_info arg!
logger.test_start("test-id-1")
logger.test_status("test-id-1",
"a-subtest",
status="FAIL",
expected="PASS",
known_intermittent=["FAIL"])
logger.test_end("test-id-1",
status="OK",)
logger.suite_end()
# check nothing got output to stdout/stderr
# (note that mozlog outputs exceptions during handling to stderr!)
captured = capfd.readouterr()
assert captured.out == ""
assert captured.err == ""
# check the actual output of the formatter
output.seek(0)
output_obj = json.load(output)
test = output_obj["results"][0]
assert test["status"] == u"OK"
subtest = test["subtests"][0]
assert subtest["expected"] == u"PASS"
assert subtest["known_intermittent"] == [u'FAIL']

View file

@ -10,7 +10,7 @@ from .state import SavedState, UnsavedState
def setup_paths(sync_path):
sys.path.insert(0, os.path.abspath(sync_path))
from tools import localpaths # noqa: flake8
from tools import localpaths # noqa: F401
class LoadConfig(Step):
"""Step for loading configuration from the ini file and kwargs."""

View file

@ -111,8 +111,11 @@ class RunInfo(dict):
self["wasm"] = False
if extras is not None:
self.update(extras)
self["headless"] = extras.get("headless", False)
self["webrender"] = enable_webrender
def _update_mozinfo(self, metadata_root):
"""Add extra build information from a mozinfo.json file in a parent
directory"""