mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55: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
|
@ -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