mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
Update web-platform-tests to revision 3bbb55915a04548e70c63b7c143a83e0e9d3c5e7
This commit is contained in:
parent
3340214a29
commit
b55cc798b6
100 changed files with 2036 additions and 3665 deletions
|
@ -25,7 +25,7 @@ job_path_map = {
|
|||
"manifest_upload": [".*"],
|
||||
"resources_unittest": ["resources/", "tools/"],
|
||||
"tools_unittest": ["tools/"],
|
||||
"wptrunner_unittest": ["tools/wptrunner/*"],
|
||||
"wptrunner_unittest": ["tools/"],
|
||||
"build_css": ["css/"],
|
||||
"update_built": ["2dcontext/",
|
||||
"html/",
|
||||
|
|
|
@ -74,7 +74,7 @@ def test_wptrunner_unittest():
|
|||
assert jobs.get_jobs(["tools/wptrunner/wptrunner/wptrunner.py"],
|
||||
includes=["wptrunner_unittest"]) == set(["wptrunner_unittest"])
|
||||
assert jobs.get_jobs(["tools/example.py"],
|
||||
includes=["wptrunner_unittest"]) == set()
|
||||
includes=["wptrunner_unittest"]) == set(["wptrunner_unittest"])
|
||||
|
||||
|
||||
def test_build_css():
|
||||
|
|
|
@ -63,16 +63,12 @@ class URLManifestItem(ManifestItem):
|
|||
|
||||
def __init__(self, tests_root, path, url_base, url, **extras):
|
||||
super(URLManifestItem, self).__init__(tests_root, path)
|
||||
assert url_base[0] == "/"
|
||||
self.url_base = url_base
|
||||
assert url[0] != "/"
|
||||
self._url = url
|
||||
self._extras = extras
|
||||
|
||||
@property
|
||||
def _source_file(self):
|
||||
"""create a SourceFile for the item"""
|
||||
from .sourcefile import SourceFile
|
||||
return SourceFile(self._tests_root, self.path, self.url_base)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
return self.url
|
||||
|
@ -80,11 +76,6 @@ class URLManifestItem(ManifestItem):
|
|||
@property
|
||||
def url(self):
|
||||
# we can outperform urljoin, because we know we just have path relative URLs
|
||||
if self._url[0] == "/":
|
||||
# TODO: MANIFEST6
|
||||
# this is actually a bug in older generated manifests, _url shouldn't
|
||||
# be an absolute path
|
||||
return self._url
|
||||
if self.url_base == "/":
|
||||
return "/" + self._url
|
||||
return urljoin(self.url_base, self._url)
|
||||
|
@ -125,12 +116,7 @@ class TestharnessTest(URLManifestItem):
|
|||
|
||||
@property
|
||||
def script_metadata(self):
|
||||
if "script_metadata" in self._extras:
|
||||
return self._extras["script_metadata"]
|
||||
else:
|
||||
# TODO: MANIFEST6
|
||||
# this branch should go when the manifest version is bumped
|
||||
return self._source_file.script_metadata
|
||||
return self._extras.get("script_metadata")
|
||||
|
||||
def to_json(self):
|
||||
rv = super(TestharnessTest, self).to_json()
|
||||
|
@ -140,8 +126,7 @@ class TestharnessTest(URLManifestItem):
|
|||
rv[-1]["testdriver"] = self.testdriver
|
||||
if self.jsshell:
|
||||
rv[-1]["jsshell"] = True
|
||||
if self.script_metadata is not None:
|
||||
# we store this even if it is [] to avoid having to read the source file
|
||||
if self.script_metadata:
|
||||
rv[-1]["script_metadata"] = self.script_metadata
|
||||
return rv
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ try:
|
|||
except ImportError:
|
||||
fast_json = json
|
||||
|
||||
CURRENT_VERSION = 5
|
||||
CURRENT_VERSION = 6
|
||||
|
||||
|
||||
class ManifestError(Exception):
|
||||
|
@ -68,8 +68,8 @@ class TypeData(object):
|
|||
self.load(key)
|
||||
return self.data[key]
|
||||
|
||||
def __bool__(self):
|
||||
return bool(self.data)
|
||||
def __nonzero__(self):
|
||||
return bool(self.data) or bool(self.json_data)
|
||||
|
||||
def __len__(self):
|
||||
rv = len(self.data)
|
||||
|
@ -86,6 +86,10 @@ class TypeData(object):
|
|||
raise KeyError
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
if self.json_data is not None:
|
||||
path = from_os_path(key)
|
||||
if path in self.json_data:
|
||||
del self.json_data[path]
|
||||
self.data[key] = value
|
||||
|
||||
def __contains__(self, key):
|
||||
|
|
|
@ -14,7 +14,7 @@ from ..item import URLManifestItem
|
|||
"a.b.serviceworker.c.d",
|
||||
])
|
||||
def test_url_https(path):
|
||||
m = URLManifestItem("/foobar", "/" + path, "/", "/foo.bar/" + path)
|
||||
m = URLManifestItem("/foo", "bar/" + path, "/", "bar/" + path)
|
||||
|
||||
assert m.https is True
|
||||
|
||||
|
@ -36,6 +36,6 @@ def test_url_https(path):
|
|||
"a.serviceworkerb.c",
|
||||
])
|
||||
def test_url_not_https(path):
|
||||
m = URLManifestItem("/foobar", "/" + path, "/", "/foo.bar/" + path)
|
||||
m = URLManifestItem("/foo", "bar/" + path, "/", "bar/" + path)
|
||||
|
||||
assert m.https is False
|
||||
|
|
|
@ -15,7 +15,7 @@ def SourceFileWithTest(path, hash, cls, **kwargs):
|
|||
if cls == item.SupportFile:
|
||||
test = cls("/foobar", path, **kwargs)
|
||||
else:
|
||||
test = cls("/foobar", path, "/", utils.rel_path_to_url(path), **kwargs)
|
||||
test = cls("/foobar", path, "/", utils.from_os_path(path), **kwargs)
|
||||
s.manifest_items = mock.Mock(return_value=(cls.item_type, [test]))
|
||||
return s
|
||||
|
||||
|
@ -58,11 +58,11 @@ def sourcefile_strategy(draw):
|
|||
ref_path = draw(rel_dir_file_path())
|
||||
h.assume(path != ref_path)
|
||||
ref_eq = draw(hs.sampled_from(["==", "!="]))
|
||||
test = cls("/foobar", path, "/", utils.rel_path_to_url(path), references=[(utils.rel_path_to_url(ref_path), ref_eq)])
|
||||
test = cls("/foobar", path, "/", utils.from_os_path(path), references=[(utils.from_os_path(ref_path), ref_eq)])
|
||||
elif cls is item.SupportFile:
|
||||
test = cls("/foobar", path)
|
||||
else:
|
||||
test = cls("/foobar", path, "/", utils.rel_path_to_url(path))
|
||||
test = cls("/foobar", path, "/", utils.from_os_path(path))
|
||||
|
||||
s.manifest_items = mock.Mock(return_value=(cls.item_type, [test]))
|
||||
return s
|
||||
|
@ -111,42 +111,36 @@ def test_manifest_to_json_forwardslash():
|
|||
'paths': {
|
||||
'a/b': ('0000000000000000000000000000000000000000', 'testharness')
|
||||
},
|
||||
'version': 5,
|
||||
'version': 6,
|
||||
'url_base': '/',
|
||||
'items': {
|
||||
'testharness': {
|
||||
'a/b': [['/a/b', {}]]
|
||||
'a/b': [['a/b', {}]]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.skipif(os.sep != "\\", reason="backslash path")
|
||||
def test_manifest_to_json_backslash():
|
||||
m = manifest.Manifest()
|
||||
|
||||
s = SourceFileWithTest("a\\b", "0"*40, item.TestharnessTest)
|
||||
|
||||
if os.path.sep == "\\":
|
||||
assert m.update([(s, True)]) is True
|
||||
assert m.update([(s, True)]) is True
|
||||
|
||||
assert m.to_json() == {
|
||||
'paths': {
|
||||
'a/b': ('0000000000000000000000000000000000000000', 'testharness')
|
||||
},
|
||||
'version': 5,
|
||||
'url_base': '/',
|
||||
'items': {
|
||||
'testharness': {
|
||||
'a/b': [['/a/b', {}]]
|
||||
}
|
||||
assert m.to_json() == {
|
||||
'paths': {
|
||||
'a/b': ('0000000000000000000000000000000000000000', 'testharness')
|
||||
},
|
||||
'version': 6,
|
||||
'url_base': '/',
|
||||
'items': {
|
||||
'testharness': {
|
||||
'a/b': [['a/b', {}]]
|
||||
}
|
||||
}
|
||||
else:
|
||||
with pytest.raises(ValueError):
|
||||
# one of these must raise ValueError
|
||||
# the first must return True if it doesn't raise
|
||||
assert m.update([(s, True)]) is True
|
||||
m.to_json()
|
||||
}
|
||||
|
||||
|
||||
def test_manifest_from_json_backslash():
|
||||
|
@ -154,11 +148,11 @@ def test_manifest_from_json_backslash():
|
|||
'paths': {
|
||||
'a\\b': ('0000000000000000000000000000000000000000', 'testharness')
|
||||
},
|
||||
'version': 5,
|
||||
'version': 6,
|
||||
'url_base': '/',
|
||||
'items': {
|
||||
'testharness': {
|
||||
'a\\b': [['/a/b', {}]]
|
||||
'a\\b': [['a/b', {}]]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -294,8 +288,8 @@ def test_iterpath():
|
|||
m = manifest.Manifest()
|
||||
|
||||
sources = [SourceFileWithTest("test1", "0"*40, item.RefTestNode, references=[("/test1-ref", "==")]),
|
||||
SourceFileWithTests("test2", "1"*40, item.TestharnessTest, [("/test2-1.html",),
|
||||
("/test2-2.html",)]),
|
||||
SourceFileWithTests("test2", "1"*40, item.TestharnessTest, [("test2-1.html",),
|
||||
("test2-2.html",)]),
|
||||
SourceFileWithTest("test3", "0"*40, item.TestharnessTest)]
|
||||
m.update([(s, True) for s in sources])
|
||||
|
||||
|
@ -308,8 +302,8 @@ def test_filter():
|
|||
m = manifest.Manifest()
|
||||
|
||||
sources = [SourceFileWithTest("test1", "0"*40, item.RefTestNode, references=[("/test1-ref", "==")]),
|
||||
SourceFileWithTests("test2", "0"*40, item.TestharnessTest, [("/test2-1.html",),
|
||||
("/test2-2.html",)]),
|
||||
SourceFileWithTests("test2", "0"*40, item.TestharnessTest, [("test2-1.html",),
|
||||
("test2-2.html",)]),
|
||||
SourceFileWithTest("test3", "0"*40, item.TestharnessTest)]
|
||||
m.update([(s, True) for s in sources])
|
||||
|
||||
|
@ -317,7 +311,7 @@ def test_filter():
|
|||
|
||||
def filter(it):
|
||||
for test in it:
|
||||
if test[0] in ["/test2-2.html", "/test3"]:
|
||||
if test[0] in ["test2-2.html", "test3"]:
|
||||
yield test
|
||||
|
||||
filtered_manifest = manifest.Manifest.from_json("/", json, types=["testharness"], meta_filters=[filter])
|
||||
|
@ -407,3 +401,26 @@ def test_update_from_json():
|
|||
test1 = s1.manifest_items()[1][0]
|
||||
|
||||
assert list(m) == [("testharness", test1.path, {test1})]
|
||||
|
||||
|
||||
def test_update_from_json_modified():
|
||||
# Create the original manifest
|
||||
m = manifest.Manifest()
|
||||
s1 = SourceFileWithTest("test1", "0"*40, item.TestharnessTest)
|
||||
m.update([(s1, True)])
|
||||
json_str = m.to_json()
|
||||
|
||||
# Reload it from JSON
|
||||
m = manifest.Manifest.from_json("/", json_str)
|
||||
|
||||
# Update it with timeout="long"
|
||||
s2 = SourceFileWithTest("test1", "1"*40, item.TestharnessTest, timeout="long")
|
||||
m.update([(s2, True)])
|
||||
json_str = m.to_json()
|
||||
assert json_str == {
|
||||
'items': {'testharness': {'test1': [['test1', {"timeout": "long"}]]}},
|
||||
'paths': {'test1': ('1111111111111111111111111111111111111111',
|
||||
'testharness')},
|
||||
'url_base': '/',
|
||||
'version': 6
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ def update_from_cli(**kwargs):
|
|||
path = kwargs["path"]
|
||||
assert tests_root is not None
|
||||
|
||||
if kwargs["download"]:
|
||||
if not kwargs["rebuild"] and kwargs["download"]:
|
||||
download_from_github(path, tests_root)
|
||||
|
||||
manifest.load_and_update(tests_root,
|
||||
|
|
|
@ -101,7 +101,7 @@ class Firefox(Browser):
|
|||
product = {
|
||||
"nightly": "firefox-nightly-latest-ssl",
|
||||
"beta": "firefox-beta-latest-ssl",
|
||||
"stable": "firefox-beta-latest-ssl"
|
||||
"stable": "firefox-latest-ssl"
|
||||
}
|
||||
|
||||
os_builds = {
|
||||
|
@ -267,7 +267,7 @@ class Firefox(Browser):
|
|||
if version:
|
||||
dest = os.path.join(dest, version)
|
||||
have_cache = False
|
||||
if os.path.exists(dest):
|
||||
if os.path.exists(dest) and len(os.listdir(dest)) > 0:
|
||||
if channel != "nightly":
|
||||
have_cache = True
|
||||
else:
|
||||
|
|
|
@ -5,3 +5,4 @@ mozdebug==0.1.1
|
|||
pillow==5.4.1
|
||||
urllib3[secure]==1.24.1
|
||||
requests==2.21.0
|
||||
six>=1.8
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
xfail_strict=true
|
||||
|
||||
[tox]
|
||||
envlist = py27-{base,chrome,edge,firefox,ie,opera,safari,sauce,servo}
|
||||
envlist = py27-{base,chrome,edge,firefox,ie,opera,safari,sauce,servo},py36-base
|
||||
skip_missing_interpreters = true
|
||||
|
||||
[testenv]
|
||||
deps =
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import ConfigParser
|
||||
from six.moves.configparser import SafeConfigParser
|
||||
import os
|
||||
import sys
|
||||
from collections import OrderedDict
|
||||
|
@ -20,7 +20,7 @@ class ConfigDict(dict):
|
|||
def read(config_path):
|
||||
config_path = os.path.abspath(config_path)
|
||||
config_root = os.path.split(config_path)[0]
|
||||
parser = ConfigParser.SafeConfigParser()
|
||||
parser = SafeConfigParser()
|
||||
success = parser.read(config_path)
|
||||
assert config_path in success, success
|
||||
|
||||
|
|
|
@ -8,12 +8,16 @@ import time
|
|||
|
||||
from mozlog import get_default_logger, handlers, proxy
|
||||
|
||||
from wptlogging import LogLevelRewriter
|
||||
from wptserve.handlers import StringHandler
|
||||
from .wptlogging import LogLevelRewriter
|
||||
|
||||
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 wptserve.handlers import StringHandler
|
||||
|
||||
serve = None
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# flake8: noqa (not ideal, but nicer than adding noqa: F401 to every line!)
|
||||
from base import (executor_kwargs,
|
||||
testharness_result_converter,
|
||||
reftest_result_converter,
|
||||
TestExecutor)
|
||||
from .base import (executor_kwargs,
|
||||
testharness_result_converter,
|
||||
reftest_result_converter,
|
||||
TestExecutor)
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
import base64
|
||||
import hashlib
|
||||
import httplib
|
||||
from six.moves.http_client import HTTPConnection
|
||||
import io
|
||||
import os
|
||||
import threading
|
||||
import traceback
|
||||
import socket
|
||||
import urlparse
|
||||
from six.moves.urllib.parse import urljoin, urlsplit, urlunsplit
|
||||
from abc import ABCMeta, abstractmethod
|
||||
|
||||
from PIL import Image, ImageChops, ImageStat
|
||||
|
||||
from ..testrunner import Stop
|
||||
from protocol import Protocol, BaseProtocolPart
|
||||
from .protocol import Protocol, BaseProtocolPart
|
||||
|
||||
here = os.path.split(__file__)[0]
|
||||
|
||||
|
@ -50,10 +50,10 @@ def strip_server(url):
|
|||
|
||||
e.g. http://example.org:8000/tests?id=1#2 becomes /tests?id=1#2"""
|
||||
|
||||
url_parts = list(urlparse.urlsplit(url))
|
||||
url_parts = list(urlsplit(url))
|
||||
url_parts[0] = ""
|
||||
url_parts[1] = ""
|
||||
return urlparse.urlunsplit(url_parts)
|
||||
return urlunsplit(url_parts)
|
||||
|
||||
|
||||
class TestharnessResultConverter(object):
|
||||
|
@ -213,7 +213,7 @@ class TestExecutor(object):
|
|||
self.server_config["ports"][protocol][0])
|
||||
|
||||
def test_url(self, test):
|
||||
return urlparse.urljoin(self.server_url(test.environment["protocol"]), test.url)
|
||||
return urljoin(self.server_url(test.environment["protocol"]), test.url)
|
||||
|
||||
@abstractmethod
|
||||
def do_test(self, test):
|
||||
|
@ -563,7 +563,7 @@ class WebDriverProtocol(Protocol):
|
|||
An HTTP request to an invalid path that results in a 404 is
|
||||
proof enough to us that the server is alive and kicking.
|
||||
"""
|
||||
conn = httplib.HTTPConnection(self.server.host, self.server.port)
|
||||
conn = HTTPConnection(self.server.host, self.server.port)
|
||||
conn.request("HEAD", self.server.base_path + "invalid")
|
||||
res = conn.getresponse()
|
||||
return res.status == 404
|
||||
|
|
|
@ -356,6 +356,20 @@ class WebDriverTestharnessExecutor(TestharnessExecutor):
|
|||
while True:
|
||||
result = protocol.base.execute_script(
|
||||
self.script_resume % format_map, async=True)
|
||||
|
||||
# As of 2019-03-29, WebDriver does not define expected behavior for
|
||||
# cases where the browser crashes during script execution:
|
||||
#
|
||||
# https://github.com/w3c/webdriver/issues/1308
|
||||
if not isinstance(result, list) or len(result) != 2:
|
||||
try:
|
||||
is_alive = self.is_alive()
|
||||
except client.WebDriverException:
|
||||
is_alive = False
|
||||
|
||||
if not is_alive:
|
||||
raise Exception("Browser crashed during script execution.")
|
||||
|
||||
done, rv = handler(result)
|
||||
if done:
|
||||
break
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import json
|
||||
import sys
|
||||
from os.path import dirname, join
|
||||
from StringIO import StringIO
|
||||
from six.moves import cStringIO as StringIO
|
||||
|
||||
from mozlog import handlers, structuredlog
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import os
|
||||
import urlparse
|
||||
from six.moves.urllib.parse import urljoin
|
||||
from collections import deque
|
||||
|
||||
from wptmanifest.backends import static
|
||||
|
@ -236,8 +236,8 @@ class ExpectedManifest(ManifestItem):
|
|||
|
||||
@property
|
||||
def url(self):
|
||||
return urlparse.urljoin(self.url_base,
|
||||
"/".join(self.test_path.split(os.path.sep)))
|
||||
return urljoin(self.url_base,
|
||||
"/".join(self.test_path.split(os.path.sep)))
|
||||
|
||||
@property
|
||||
def disabled(self):
|
||||
|
@ -364,7 +364,7 @@ class TestNode(ManifestItem):
|
|||
|
||||
@property
|
||||
def id(self):
|
||||
return urlparse.urljoin(self.parent.url, self.name)
|
||||
return urljoin(self.parent.url, self.name)
|
||||
|
||||
@property
|
||||
def disabled(self):
|
||||
|
|
|
@ -6,7 +6,7 @@ be included or excluded.
|
|||
"""
|
||||
import glob
|
||||
import os
|
||||
import urlparse
|
||||
from six.moves.urllib.parse import urlparse, urlsplit
|
||||
|
||||
from wptmanifest.node import DataNode
|
||||
from wptmanifest.backends import conditional
|
||||
|
@ -68,7 +68,7 @@ class IncludeManifest(ManifestItem):
|
|||
|
||||
def _get_components(self, url):
|
||||
rv = []
|
||||
url_parts = urlparse.urlsplit(url)
|
||||
url_parts = urlsplit(url)
|
||||
variant = ""
|
||||
if url_parts.query:
|
||||
variant += "?" + url_parts.query
|
||||
|
@ -103,7 +103,7 @@ class IncludeManifest(ManifestItem):
|
|||
continue
|
||||
url = test.url
|
||||
if query or fragment:
|
||||
parsed = urlparse.urlparse(url)
|
||||
parsed = urlparse(url)
|
||||
if ((query and query != parsed.query) or
|
||||
(fragment and fragment != parsed.fragment)):
|
||||
continue
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import print_function
|
||||
import itertools
|
||||
import os
|
||||
import urlparse
|
||||
from six.moves.urllib.parse import urljoin
|
||||
from collections import namedtuple, defaultdict
|
||||
from math import ceil
|
||||
|
||||
|
@ -114,8 +114,8 @@ class ExpectedManifest(ManifestItem):
|
|||
|
||||
@property
|
||||
def url(self):
|
||||
return urlparse.urljoin(self.url_base,
|
||||
"/".join(self.test_path.split(os.path.sep)))
|
||||
return urljoin(self.url_base,
|
||||
"/".join(self.test_path.split(os.path.sep)))
|
||||
|
||||
def set_lsan(self, run_info, result):
|
||||
"""Set the result of the test in a particular run
|
||||
|
@ -195,7 +195,7 @@ class TestNode(ManifestItem):
|
|||
@property
|
||||
def id(self):
|
||||
"""The id of the test represented by this TestNode"""
|
||||
return urlparse.urljoin(self.parent.url, self.name)
|
||||
return urljoin(self.parent.url, self.name)
|
||||
|
||||
def disabled(self, run_info):
|
||||
"""Boolean indicating whether this test is disabled when run in an
|
||||
|
|
|
@ -8,12 +8,12 @@ from collections import defaultdict, namedtuple
|
|||
|
||||
from mozlog import structuredlog
|
||||
|
||||
import manifestupdate
|
||||
import testloader
|
||||
import wptmanifest
|
||||
import wpttest
|
||||
from expected import expected_path
|
||||
from vcs import git
|
||||
from . import manifestupdate
|
||||
from . import testloader
|
||||
from . import wptmanifest
|
||||
from . import wpttest
|
||||
from .expected import expected_path
|
||||
from .vcs import git
|
||||
manifest = None # Module that will be imported relative to test_root
|
||||
manifestitem = None
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import hashlib
|
||||
import os
|
||||
import urlparse
|
||||
from six.moves.urllib.parse import urlsplit
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from Queue import Empty
|
||||
from six.moves.queue import Empty
|
||||
from collections import defaultdict, deque
|
||||
from multiprocessing import Queue
|
||||
|
||||
import manifestinclude
|
||||
import manifestexpected
|
||||
import wpttest
|
||||
from . import manifestinclude
|
||||
from . import manifestexpected
|
||||
from . import wpttest
|
||||
from mozlog import structured
|
||||
|
||||
manifest = None
|
||||
|
@ -348,7 +348,7 @@ class PathGroupedSource(GroupedSource):
|
|||
depth = kwargs.get("depth")
|
||||
if depth is True or depth == 0:
|
||||
depth = None
|
||||
path = urlparse.urlsplit(test.url).path.split("/")[1:-1][:depth]
|
||||
path = urlsplit(test.url).path.split("/")[1:-1][:depth]
|
||||
rv = path != state.get("prev_path")
|
||||
state["prev_path"] = path
|
||||
return rv
|
||||
|
|
|
@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
|||
import multiprocessing
|
||||
import threading
|
||||
import traceback
|
||||
from Queue import Empty
|
||||
from six.moves.queue import Empty
|
||||
from collections import namedtuple
|
||||
from multiprocessing import Process, current_process, Queue
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import pytest
|
|||
|
||||
sys.path.insert(0, join(dirname(__file__), "..", ".."))
|
||||
|
||||
from wptrunner import browsers
|
||||
from .. import browsers
|
||||
|
||||
|
||||
_products = browsers.product_list
|
||||
|
|
|
@ -1,17 +1,13 @@
|
|||
import json
|
||||
import sys
|
||||
import time
|
||||
from os.path import dirname, join
|
||||
from StringIO import StringIO
|
||||
from six.moves import cStringIO as StringIO
|
||||
|
||||
import mock
|
||||
|
||||
from mozlog import handlers, structuredlog
|
||||
|
||||
sys.path.insert(0, join(dirname(__file__), "..", ".."))
|
||||
|
||||
from wptrunner.formatters import wptreport
|
||||
from wptrunner.formatters.wptreport import WptreportFormatter
|
||||
from ..formatters import wptreport
|
||||
from ..formatters.wptreport import WptreportFormatter
|
||||
|
||||
|
||||
def test_wptreport_runtime(capfd):
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
import os
|
||||
import sys
|
||||
from io import BytesIO
|
||||
|
||||
import pytest
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", ".."))
|
||||
|
||||
from wptrunner import manifestexpected
|
||||
from .. import manifestexpected
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="bytes/text confusion in py3")
|
||||
@pytest.mark.parametrize("fuzzy, expected", [
|
||||
(b"ref.html:1;200", [("ref.html", ((1, 1), (200, 200)))]),
|
||||
(b"ref.html:0-1;100-200", [("ref.html", ((0, 1), (100, 200)))]),
|
||||
|
|
|
@ -1,17 +1,12 @@
|
|||
import sys
|
||||
|
||||
from os.path import join, dirname
|
||||
|
||||
import mock
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
from .base import all_products, active_products
|
||||
|
||||
sys.path.insert(0, join(dirname(__file__), "..", "..", "..", "..")) # repo root
|
||||
from tools import localpaths # noqa: flake8
|
||||
|
||||
from wptrunner import environment
|
||||
from wptrunner import products
|
||||
from .. import environment
|
||||
from .. import products
|
||||
|
||||
test_paths = {"/": {"tests_path": join(dirname(__file__), "..", "..", "..", "..")}} # repo root
|
||||
environment.do_delayed_imports(None, test_paths)
|
||||
|
@ -24,7 +19,9 @@ def test_load_active_product(product):
|
|||
# test passes if it doesn't throw
|
||||
|
||||
|
||||
@all_products("product")
|
||||
@all_products("product", marks={
|
||||
"firefox": pytest.mark.xfail(sys.version[0] == "3", reason="mozinfo 0.10 doesn't support py3"),
|
||||
})
|
||||
def test_load_all_products(product):
|
||||
"""test every product either loads or throws ImportError"""
|
||||
try:
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
import sys
|
||||
from os.path import dirname, join
|
||||
|
||||
sys.path.insert(0, join(dirname(__file__), "..", ".."))
|
||||
|
||||
from wptrunner import stability
|
||||
from .. import stability
|
||||
|
||||
|
||||
def test_is_inconsistent():
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
import pytest
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
|
||||
|
||||
from mozlog import structured
|
||||
from wptrunner.testloader import TestFilter as Filter
|
||||
from ..testloader import TestFilter as Filter
|
||||
from .test_wpttest import make_mock_manifest
|
||||
|
||||
structured.set_default_logger(structured.structuredlog.StructuredLogger("TestLoader"))
|
||||
|
@ -23,6 +20,8 @@ skip: true
|
|||
|
||||
@pytest.mark.xfail(sys.platform == "win32",
|
||||
reason="NamedTemporaryFile cannot be reopened on Win32")
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="wptmanifest.parser doesn't support py3")
|
||||
def test_filter_unicode():
|
||||
tests = make_mock_manifest(("test", "a", 10), ("test", "a/b", 10),
|
||||
("test", "c", 10))
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import json
|
||||
import mock
|
||||
import os
|
||||
import pytest
|
||||
import sys
|
||||
from io import BytesIO
|
||||
|
||||
|
@ -13,18 +14,14 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, os.pardir,
|
|||
from manifest import manifest, item as manifest_item
|
||||
|
||||
|
||||
def rel_path_to_url(rel_path, url_base="/"):
|
||||
def rel_path_to_test_url(rel_path):
|
||||
assert not os.path.isabs(rel_path)
|
||||
if url_base[0] != "/":
|
||||
url_base = "/" + url_base
|
||||
if url_base[-1] != "/":
|
||||
url_base += "/"
|
||||
return url_base + rel_path.replace(os.sep, "/")
|
||||
return rel_path.replace(os.sep, "/")
|
||||
|
||||
|
||||
def SourceFileWithTest(path, hash, cls, *args):
|
||||
s = mock.Mock(rel_path=path, hash=hash)
|
||||
test = cls("/foobar", path, "/", rel_path_to_url(path), *args)
|
||||
test = cls("/foobar", path, "/", rel_path_to_test_url(path), *args)
|
||||
s.manifest_items = mock.Mock(return_value=(cls.item_type, [test]))
|
||||
return s
|
||||
|
||||
|
@ -101,6 +98,8 @@ def create_test_manifest(tests, url_base="/"):
|
|||
return m
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_0():
|
||||
tests = [("path/to/test.htm", ["/path/to/test.htm"], "testharness",
|
||||
"""[test.htm]
|
||||
|
@ -121,6 +120,8 @@ def test_update_0():
|
|||
assert updated[0][1].is_empty
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_1():
|
||||
test_id = "/path/to/test.htm"
|
||||
tests = [("path/to/test.htm", [test_id], "testharness",
|
||||
|
@ -143,6 +144,8 @@ def test_update_1():
|
|||
assert new_manifest.get_test(test_id).children[0].get("expected") == "FAIL"
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_skip_0():
|
||||
test_id = "/path/to/test.htm"
|
||||
tests = [("path/to/test.htm", [test_id], "testharness",
|
||||
|
@ -162,6 +165,8 @@ def test_skip_0():
|
|||
assert not updated
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_new_subtest():
|
||||
test_id = "/path/to/test.htm"
|
||||
tests = [("path/to/test.htm", [test_id], "testharness", """[test.htm]
|
||||
|
@ -186,6 +191,8 @@ def test_new_subtest():
|
|||
assert new_manifest.get_test(test_id).children[1].get("expected") == "FAIL"
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_multiple_0():
|
||||
test_id = "/path/to/test.htm"
|
||||
tests = [("path/to/test.htm", [test_id], "testharness", """[test.htm]
|
||||
|
@ -220,6 +227,8 @@ def test_update_multiple_0():
|
|||
"expected", {"debug": False, "os": "linux"}) == "TIMEOUT"
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_multiple_1():
|
||||
test_id = "/path/to/test.htm"
|
||||
tests = [("path/to/test.htm", [test_id], "testharness", """[test.htm]
|
||||
|
@ -256,6 +265,8 @@ def test_update_multiple_1():
|
|||
"expected", {"debug": False, "os": "windows"}) == "FAIL"
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_multiple_2():
|
||||
test_id = "/path/to/test.htm"
|
||||
tests = [("path/to/test.htm", [test_id], "testharness", """[test.htm]
|
||||
|
@ -290,6 +301,8 @@ def test_update_multiple_2():
|
|||
"expected", {"debug": True, "os": "osx"}) == "TIMEOUT"
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_multiple_3():
|
||||
test_id = "/path/to/test.htm"
|
||||
tests = [("path/to/test.htm", [test_id], "testharness", """[test.htm]
|
||||
|
@ -326,6 +339,8 @@ def test_update_multiple_3():
|
|||
"expected", {"debug": True, "os": "osx"}) == "TIMEOUT"
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_ignore_existing():
|
||||
test_id = "/path/to/test.htm"
|
||||
tests = [("path/to/test.htm", [test_id], "testharness", """[test.htm]
|
||||
|
@ -362,6 +377,8 @@ def test_update_ignore_existing():
|
|||
"expected", {"debug": False, "os": "osx"}) == "NOTRUN"
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_assertion_count_0():
|
||||
test_id = "/path/to/test.htm"
|
||||
tests = [("path/to/test.htm", [test_id], "testharness", """[test.htm]
|
||||
|
@ -385,6 +402,8 @@ def test_update_assertion_count_0():
|
|||
assert new_manifest.get_test(test_id).get("min-asserts") == 2
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_assertion_count_1():
|
||||
test_id = "/path/to/test.htm"
|
||||
tests = [("path/to/test.htm", [test_id], "testharness", """[test.htm]
|
||||
|
@ -408,6 +427,8 @@ def test_update_assertion_count_1():
|
|||
assert new_manifest.get_test(test_id).has_key("min-asserts") is False
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_assertion_count_2():
|
||||
test_id = "/path/to/test.htm"
|
||||
tests = [("path/to/test.htm", [test_id], "testharness", """[test.htm]
|
||||
|
@ -427,6 +448,8 @@ def test_update_assertion_count_2():
|
|||
assert not updated
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_assertion_count_3():
|
||||
test_id = "/path/to/test.htm"
|
||||
tests = [("path/to/test.htm", [test_id], "testharness", """[test.htm]
|
||||
|
@ -460,6 +483,8 @@ def test_update_assertion_count_3():
|
|||
assert new_manifest.get_test(test_id).get("min-asserts") == 2
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_assertion_count_4():
|
||||
test_id = "/path/to/test.htm"
|
||||
tests = [("path/to/test.htm", [test_id], "testharness", """[test.htm]""")]
|
||||
|
@ -490,6 +515,8 @@ def test_update_assertion_count_4():
|
|||
assert new_manifest.get_test(test_id).has_key("min-asserts") is False
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_lsan_0():
|
||||
test_id = "/path/to/test.htm"
|
||||
dir_id = "path/to/__dir__"
|
||||
|
@ -507,6 +534,8 @@ def test_update_lsan_0():
|
|||
assert new_manifest.get("lsan-allowed") == ["foo"]
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_lsan_1():
|
||||
test_id = "/path/to/test.htm"
|
||||
dir_id = "path/to/__dir__"
|
||||
|
@ -527,6 +556,8 @@ lsan-allowed: [foo]""")]
|
|||
assert new_manifest.get("lsan-allowed") == ["baz", "foo"]
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_lsan_2():
|
||||
test_id = "/path/to/test.htm"
|
||||
dir_id = "path/to/__dir__"
|
||||
|
@ -549,6 +580,8 @@ lsan-allowed: [foo]"""),
|
|||
assert new_manifest.get("lsan-allowed") == ["baz"]
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_lsan_3():
|
||||
test_id = "/path/to/test.htm"
|
||||
dir_id = "path/to/__dir__"
|
||||
|
@ -571,6 +604,8 @@ def test_update_lsan_3():
|
|||
assert new_manifest.get("lsan-allowed") == ["baz", "foo"]
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_wptreport_0():
|
||||
tests = [("path/to/test.htm", ["/path/to/test.htm"], "testharness",
|
||||
"""[test.htm]
|
||||
|
@ -591,6 +626,8 @@ def test_update_wptreport_0():
|
|||
assert updated[0][1].is_empty
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_wptreport_1():
|
||||
tests = [("path/to/test.htm", ["/path/to/test.htm"], "testharness", ""),
|
||||
("path/to/__dir__", ["path/to/__dir__"], None, "")]
|
||||
|
@ -606,6 +643,8 @@ def test_update_wptreport_1():
|
|||
assert updated[0][1].get("lsan-allowed") == ["baz"]
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_leak_total_0():
|
||||
test_id = "/path/to/test.htm"
|
||||
dir_id = "path/to/__dir__"
|
||||
|
@ -625,6 +664,8 @@ def test_update_leak_total_0():
|
|||
assert new_manifest.get("leak-threshold") == ['default:51200']
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_leak_total_1():
|
||||
test_id = "/path/to/test.htm"
|
||||
dir_id = "path/to/__dir__"
|
||||
|
@ -641,6 +682,8 @@ def test_update_leak_total_1():
|
|||
assert not updated
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_leak_total_2():
|
||||
test_id = "/path/to/test.htm"
|
||||
dir_id = "path/to/__dir__"
|
||||
|
@ -658,6 +701,8 @@ leak-total: 110""")]
|
|||
assert not updated
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_leak_total_3():
|
||||
test_id = "/path/to/test.htm"
|
||||
dir_id = "path/to/__dir__"
|
||||
|
@ -678,6 +723,8 @@ leak-total: 100""")]
|
|||
assert new_manifest.get("leak-threshold") == ['default:51200']
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="metadata doesn't support py3")
|
||||
def test_update_leak_total_4():
|
||||
test_id = "/path/to/test.htm"
|
||||
dir_id = "path/to/__dir__"
|
||||
|
@ -710,6 +757,8 @@ class TestStep(Step):
|
|||
class UpdateRunner(StepRunner):
|
||||
steps = [TestStep]
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="update.state doesn't support py3")
|
||||
def test_update_pickle():
|
||||
logger = structuredlog.StructuredLogger("expected_test")
|
||||
args = {
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
import os
|
||||
import pytest
|
||||
import sys
|
||||
from io import BytesIO
|
||||
|
||||
from mock import Mock
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
|
||||
|
||||
from manifest import manifest as wptmanifest
|
||||
from manifest.item import TestharnessTest
|
||||
from wptrunner import manifestexpected, wpttest
|
||||
from .. import manifestexpected, wpttest
|
||||
|
||||
dir_ini_0 = """\
|
||||
prefs: [a:b]
|
||||
|
@ -69,6 +66,8 @@ def make_mock_manifest(*items):
|
|||
return rv
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="bytes/text confusion in py3")
|
||||
def test_metadata_inherit():
|
||||
tests = make_mock_manifest(("test", "a", 10), ("test", "a/b", 10),
|
||||
("test", "c", 10))
|
||||
|
@ -93,6 +92,8 @@ def test_metadata_inherit():
|
|||
assert test_obj.tags == {"a", "dir:a"}
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="bytes/text confusion in py3")
|
||||
def test_conditional():
|
||||
tests = make_mock_manifest(("test", "a", 10), ("test", "a/b", 10),
|
||||
("test", "c", 10))
|
||||
|
@ -109,6 +110,8 @@ def test_conditional():
|
|||
assert test_obj.expected() == "FAIL"
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="bytes/text confusion in py3")
|
||||
def test_metadata_lsan_stack_depth():
|
||||
tests = make_mock_manifest(("test", "a", 10), ("test", "a/b", 10))
|
||||
|
||||
|
@ -147,14 +150,16 @@ def test_metadata_lsan_stack_depth():
|
|||
assert test_obj.lsan_max_stack_depth == 42
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="bytes/text confusion in py3")
|
||||
def test_metadata_fuzzy():
|
||||
manifest_data = {
|
||||
"items": {"reftest": {"a/fuzzy.html": [["/a/fuzzy.html",
|
||||
"items": {"reftest": {"a/fuzzy.html": [["a/fuzzy.html",
|
||||
[["/a/fuzzy-ref.html", "=="]],
|
||||
{"fuzzy": [[["/a/fuzzy.html", '/a/fuzzy-ref.html', '=='],
|
||||
[[2, 3], [10, 15]]]]}]]}},
|
||||
"paths": {"a/fuzzy.html": ["0"*40, "reftest"]},
|
||||
"version": wptmanifest.CURRENT_VERSION,
|
||||
"version": 6,
|
||||
"url_base": "/"}
|
||||
manifest = wptmanifest.Manifest.from_json(".", manifest_data)
|
||||
test_metadata = manifestexpected.static.compile(BytesIO(test_fuzzy),
|
||||
|
|
|
@ -4,7 +4,7 @@ from mozlog.structured import structuredlog, commandline
|
|||
|
||||
from .. import wptcommandline
|
||||
|
||||
from update import WPTUpdate
|
||||
from .update import WPTUpdate
|
||||
|
||||
def remove_logging_args(args):
|
||||
"""Take logging args out of the dictionary of command line arguments so
|
||||
|
|
|
@ -2,7 +2,7 @@ import os
|
|||
|
||||
from .. import metadata, products
|
||||
|
||||
from base import Step, StepRunner
|
||||
from .base import Step, StepRunner
|
||||
|
||||
|
||||
class GetUpdatePropertyList(Step):
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import os
|
||||
import cPickle as pickle
|
||||
from six.moves import cPickle as pickle # noqa: N813
|
||||
|
||||
here = os.path.abspath(os.path.split(__file__)[0])
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@ import shutil
|
|||
import sys
|
||||
import uuid
|
||||
|
||||
from base import Step, StepRunner
|
||||
from tree import Commit
|
||||
from .base import Step, StepRunner
|
||||
from .tree import Commit
|
||||
|
||||
here = os.path.abspath(os.path.split(__file__)[0])
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
from metadata import MetadataUpdateRunner
|
||||
from sync import SyncFromUpstreamRunner
|
||||
from tree import GitTree, HgTree, NoVCSTree
|
||||
from .metadata import MetadataUpdateRunner
|
||||
from .sync import SyncFromUpstreamRunner
|
||||
from .tree import GitTree, HgTree, NoVCSTree
|
||||
|
||||
from base import Step, StepRunner, exit_clean, exit_unclean
|
||||
from state import SavedState, UnsavedState
|
||||
from .base import Step, StepRunner, exit_clean, exit_unclean
|
||||
from .state import SavedState, UnsavedState
|
||||
|
||||
def setup_paths(sync_path):
|
||||
sys.path.insert(0, os.path.abspath(sync_path))
|
||||
|
|
|
@ -6,9 +6,9 @@ from collections import OrderedDict
|
|||
from distutils.spawn import find_executable
|
||||
from datetime import timedelta
|
||||
|
||||
import config
|
||||
import wpttest
|
||||
from formatters import chromium, wptreport, wptscreenshot
|
||||
from . import config
|
||||
from . import wpttest
|
||||
from .formatters import chromium, wptreport, wptscreenshot
|
||||
|
||||
def abs_path(path):
|
||||
return os.path.abspath(os.path.expanduser(path))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import logging
|
||||
import sys
|
||||
import threading
|
||||
from StringIO import StringIO
|
||||
from six import StringIO
|
||||
from multiprocessing import Queue
|
||||
|
||||
from mozlog import commandline, stdadapter, set_default_logger
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# flake8: noqa (not ideal, but nicer than adding noqa: F401 to every line!)
|
||||
from serializer import serialize
|
||||
from parser import parse
|
||||
from backends.static import compile as compile_static
|
||||
from backends.conditional import compile as compile_condition
|
||||
from .serializer import serialize
|
||||
from .parser import parse
|
||||
from .backends.static import compile as compile_static
|
||||
from .backends.conditional import compile as compile_condition
|
||||
|
|
|
@ -14,12 +14,12 @@
|
|||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from cStringIO import StringIO
|
||||
from six.moves import cStringIO as StringIO
|
||||
|
||||
from node import (AtomNode, BinaryExpressionNode, BinaryOperatorNode,
|
||||
ConditionalNode, DataNode, IndexNode, KeyValueNode, ListNode,
|
||||
NumberNode, StringNode, UnaryExpressionNode,
|
||||
UnaryOperatorNode, ValueNode, VariableNode)
|
||||
from .node import (AtomNode, BinaryExpressionNode, BinaryOperatorNode,
|
||||
ConditionalNode, DataNode, IndexNode, KeyValueNode, ListNode,
|
||||
NumberNode, StringNode, UnaryExpressionNode,
|
||||
UnaryOperatorNode, ValueNode, VariableNode)
|
||||
|
||||
|
||||
class ParseError(Exception):
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from node import NodeVisitor, ValueNode, ListNode, BinaryExpressionNode
|
||||
from parser import atoms, precedence
|
||||
from .node import NodeVisitor, ValueNode, ListNode, BinaryExpressionNode
|
||||
from .parser import atoms, precedence
|
||||
|
||||
atom_names = {v:"@%s" % k for (k,v) in atoms.iteritems()}
|
||||
atom_names = {v:"@%s" % k for (k,v) in atoms.items()}
|
||||
|
||||
named_escapes = set(["\a", "\b", "\f", "\n", "\r", "\t", "\v"])
|
||||
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
import pytest
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from ..backends import conditional
|
||||
from ..node import BinaryExpressionNode, BinaryOperatorNode, VariableNode, NumberNode
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="wptmanifest.parser doesn't support py3")
|
||||
class TestConditional(unittest.TestCase):
|
||||
def compile(self, input_text):
|
||||
return conditional.compile(input_text)
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import pytest
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from cStringIO import StringIO
|
||||
from six.moves import cStringIO as StringIO
|
||||
|
||||
from .. import parser
|
||||
|
||||
|
@ -8,6 +10,8 @@ from .. import parser
|
|||
# use test_serializer for the majority of cases
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="wptmanifest.parser doesn't support py3")
|
||||
class TestExpression(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.parser = parser.Parser()
|
||||
|
|
|
@ -6,6 +6,8 @@ import pytest
|
|||
from .. import parser, serializer
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="wptmanifest.parser doesn't support py3")
|
||||
class TokenizerTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.serializer = serializer.ManifestSerializer()
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import pytest
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from ..backends import static
|
||||
|
@ -6,6 +8,8 @@ from ..backends import static
|
|||
# use test_serializer for the majority of cases
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="wptmanifest.parser doesn't support py3")
|
||||
class TestStatic(unittest.TestCase):
|
||||
def compile(self, input_text, input_data):
|
||||
return static.compile(input_text, input_data)
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
import sys
|
||||
import os
|
||||
import pytest
|
||||
import unittest
|
||||
|
||||
sys.path.insert(0, os.path.abspath(".."))
|
||||
from cStringIO import StringIO
|
||||
from six.moves import cStringIO as StringIO
|
||||
|
||||
from .. import parser
|
||||
from ..parser import token_types
|
||||
|
||||
|
||||
@pytest.mark.xfail(sys.version[0] == "3",
|
||||
reason="Tokenizer doesn't support py3")
|
||||
class TokenizerTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.tokenizer = parser.Tokenizer()
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import os
|
||||
import subprocess
|
||||
import urlparse
|
||||
from six.moves.urllib.parse import urljoin
|
||||
from collections import defaultdict
|
||||
|
||||
from wptmanifest.parser import atoms
|
||||
from .wptmanifest.parser import atoms
|
||||
|
||||
atom_reset = atoms["Reset"]
|
||||
enabled_tests = set(["testharness", "reftest", "wdspec"])
|
||||
|
@ -473,11 +473,11 @@ class ReftestTest(Test):
|
|||
values = {}
|
||||
for key, data in value:
|
||||
if len(key) == 3:
|
||||
key[0] = urlparse.urljoin(self.url, key[0])
|
||||
key[1] = urlparse.urljoin(self.url, key[1])
|
||||
key[0] = urljoin(self.url, key[0])
|
||||
key[1] = urljoin(self.url, key[1])
|
||||
else:
|
||||
# Key is just a relative url to a ref
|
||||
key = urlparse.urljoin(self.url, key)
|
||||
key = urljoin(self.url, key)
|
||||
values[key] = data
|
||||
return values
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue