Update web-platform-tests to revision c2e5b9fbaa17424f05ca2bb04609790a3b61d5c2

This commit is contained in:
WPT Sync Bot 2019-03-17 21:51:47 -04:00 committed by Josh Matthews
parent db7bb2a510
commit f2c1b70e4a
138 changed files with 2799 additions and 851 deletions

View file

@ -16,7 +16,7 @@ steps:
- template: install_safari.yml
- template: update_hosts.yml
- template: update_manifest.yml
- script: no_proxy='*' ./wpt run --yes --no-pause --no-fail-on-unexpected --no-restart-on-unexpected --affected ${{ parameters.affectedRange }} --log-wptreport $(Build.ArtifactStagingDirectory)/wpt_report.json --log-wptscreenshot $(Build.ArtifactStagingDirectory)/wpt_screenshot.txt --channel preview safari
- script: no_proxy='*' ./wpt run --yes --no-pause --no-fail-on-unexpected --no-restart-on-unexpected --affected ${{ parameters.affectedRange }} --log-wptreport $(Build.ArtifactStagingDirectory)/wpt_report.json --channel preview safari
displayName: 'Run tests'
- task: PublishBuildArtifacts@1
displayName: 'Publish results'

View file

@ -39,18 +39,13 @@ class ManifestItem(object):
"""A unique identifier for the test"""
return (self.item_type, self.id)
def meta_key(self):
"""Extra metadata that doesn't form part of the test identity, but for
which changes mean regenerating the manifest (e.g. the test timeout)."""
return ()
def __eq__(self, other):
if not hasattr(other, "key"):
return False
return self.key() == other.key()
def __hash__(self):
return hash(self.key() + self.meta_key())
return hash(self.key())
def __repr__(self):
return "<%s.%s id=%s, path=%s>" % (self.__module__, self.__class__.__name__, self.id, self.path)
@ -137,12 +132,6 @@ class TestharnessTest(URLManifestItem):
# this branch should go when the manifest version is bumped
return self._source_file.script_metadata
def meta_key(self):
script_metadata = self.script_metadata
if script_metadata is not None:
script_metadata = tuple(tuple(x) for x in script_metadata)
return (self.timeout, self.testdriver, self.jsshell, script_metadata)
def to_json(self):
rv = super(TestharnessTest, self).to_json()
if self.timeout is not None:
@ -189,9 +178,6 @@ class RefTestBase(URLManifestItem):
for item in self._extras.get("fuzzy", [])}
return rv
def meta_key(self):
return (self.timeout, self.viewport_size, self.dpi)
def to_json(self):
rv = [self._url, self.references, {}]
extras = rv[-1]

View file

@ -162,6 +162,21 @@ class TypeData(object):
self.tests_root = tests_root
self.json_data = data
def to_json(self):
data = {
from_os_path(path):
[t for t in sorted(test.to_json() for test in tests)]
for path, tests in iteritems(self.data)
}
if self.json_data is not None:
if not data:
# avoid copying if there's nothing here yet
return self.json_data
data.update(self.json_data)
return data
def paths(self):
"""Get a list of all paths containing items of this type,
without actually constructing all the items"""
@ -363,11 +378,7 @@ class Manifest(object):
def to_json(self):
out_items = {
test_type: {
from_os_path(path):
[t for t in sorted(test.to_json() for test in tests)]
for path, tests in iteritems(type_paths)
}
test_type: type_paths.to_json()
for test_type, type_paths in iteritems(self._data) if type_paths
}
rv = {"url_base": self.url_base,

View file

@ -843,6 +843,8 @@ class SourceFile(object):
self.rel_path
)]
assert len(rv[1]) == len(set(rv[1]))
self.items_cache = rv
return rv

View file

@ -1,6 +1,6 @@
import pytest
from ..item import URLManifestItem, TestharnessTest
from ..item import URLManifestItem
@pytest.mark.parametrize("path", [
@ -39,28 +39,3 @@ def test_url_not_https(path):
m = URLManifestItem("/foobar", "/" + path, "/", "/foo.bar/" + path)
assert m.https is False
def test_testharness_meta_key_includes_jsshell():
a = TestharnessTest("/foobar", "/foo", "/foo.bar", "/foo.bar/foo",
jsshell=False, script_metadata=[])
b = TestharnessTest("/foobar", "/foo", "/foo.bar", "/foo.bar/foo",
jsshell=True, script_metadata=[])
assert a.meta_key() != b.meta_key()
@pytest.mark.parametrize("script_metadata", [
None,
[],
[('script', '/resources/WebIDLParser.js'), ('script', '/resources/idlharness.js')],
[[u'script', u'/resources/WebIDLParser.js'], [u'script', u'/resources/idlharness.js']],
])
def test_testharness_hashable_script_metadata(script_metadata):
a = TestharnessTest("/",
"BackgroundSync/interfaces.https.any.js",
"/",
"/BackgroundSync/interfaces.https.any.js",
script_metadata=script_metadata)
assert hash(a) is not None

View file

@ -69,25 +69,23 @@ class Git(object):
manifest_path=manifest_path, rebuild=rebuild)
def _local_changes(self):
changes = {}
"""get a set of files which have changed between HEAD and working copy"""
changes = set()
cmd = ["status", "-z", "--ignore-submodules=all"]
data = self.git(*cmd)
if data == "":
return changes
rename_data = None
for entry in data.split("\0")[:-1]:
if rename_data is not None:
status, rel_path = entry.split(" ")
if status[0] == "R":
rename_data = (rel_path, status)
else:
changes[rel_path] = (status, None)
in_rename = False
for line in data.split(b"\0")[:-1]:
if in_rename:
changes.add(line)
in_rename = False
else:
rel_path = entry
changes[rel_path] = rename_data
rename_data = None
status = line[:2]
if b"R" in status or b"C" in status:
in_rename = True
changes.add(line[3:])
return changes
def _show_file(self, path):
@ -98,8 +96,8 @@ class Git(object):
cmd = ["ls-tree", "-r", "-z", "HEAD"]
local_changes = self._local_changes()
for result in self.git(*cmd).split("\0")[:-1]:
rel_path = result.split("\t")[-1]
hash = result.split()[2]
rel_path = result.rsplit("\t", 1)[-1]
hash = result.split(" ", 3)[2]
if rel_path in local_changes:
contents = self._show_file(rel_path)
else: