Backed out 2 changesets (bug 1474569, bug 1474581) for wpt failures in test harness output on a CLOSED TREE

Backed out changeset b39da1b094e9 (bug 1474581)
Backed out changeset d8c824521e7b (bug 1474569)
This commit is contained in:
shindli 2018-07-11 19:26:06 +03:00
Родитель 6ebdc07a36
Коммит 3b23613202
3 изменённых файлов: 5 добавлений и 35 удалений

Просмотреть файл

@ -369,19 +369,8 @@ def load_wpt_tests(requested_paths, excluded_paths, debug):
os.path.join(here, "testharnessreport.js"),
]
def resolve(test_path, script):
if script.startswith("/"):
return os.path.join(wpt, script[1:])
return os.path.join(test_path, script)
return [
RefTestCase(
wpt,
test_path,
extra_helper_paths=extra_helper_paths + [resolve(test_path, s) for s in test.scripts],
wpt=test
)
RefTestCase(wpt, test_path, extra_helper_paths=extra_helper_paths, wpt=test)
for test_path, test_type, test in loader.iter_tests()
]

Просмотреть файл

@ -70,30 +70,23 @@ class TestResult:
from wptrunner.executors.base import testharness_result_converter
rc = output.rc
stdout = output.out.split("\n")
if rc != 0:
if rc == 3:
harness_status = "ERROR"
harness_message = "Exit code reported exception"
else:
harness_status = "CRASH"
harness_message = "Exit code reported crash"
tests = []
else:
for (idx, line) in enumerate(stdout):
for line in output.out.split("\n"):
if line.startswith("WPT OUTPUT: "):
msg = line[len("WPT OUTPUT: "):]
data = [output.test.wpt.url] + json.loads(msg)
harness_status_obj, tests = testharness_result_converter(output.test.wpt, data)
harness_status = harness_status_obj.status
harness_message = "Reported by harness: %s" % (harness_status_obj.message,)
del stdout[idx]
break
else:
harness_status = "ERROR"
harness_message = "No harness output found"
tests = []
stdout.append("Harness status: %s (%s)" % (harness_status, harness_message))
result = cls.PASS
results = []
@ -104,21 +97,12 @@ class TestResult:
result = cls.FAIL
else:
for test in tests:
test_output = "Subtest \"%s\": " % (test.name,)
expected = output.test.wpt.expected(test.name)
if test.status == expected:
if test.status == output.test.wpt.expected(test.name):
test_result = (cls.PASS, "")
test_output += "as expected: %s" % (test.status,)
else:
test_result = (cls.FAIL, test.message)
result = cls.FAIL
test_output += "expected %s, found %s" % (expected, test.status)
if test.message:
test_output += " (with message: \"%s\")" % (test.message,)
results.append(test_result)
stdout.append(test_output)
output.out = "\n".join(stdout) + "\n"
return cls(output.test, result, results)

Просмотреть файл

@ -265,13 +265,12 @@ class TestharnessTest(Test):
def __init__(self, tests_root, url, inherit_metadata, test_metadata,
timeout=None, path=None, protocol="http", testdriver=False,
jsshell=False, scripts=None):
jsshell=False):
Test.__init__(self, tests_root, url, inherit_metadata, test_metadata, timeout,
path, protocol)
self.testdriver = testdriver
self.jsshell = jsshell
self.scripts = scripts or []
@classmethod
def from_manifest(cls, manifest_item, inherit_metadata, test_metadata):
@ -279,7 +278,6 @@ class TestharnessTest(Test):
protocol = "https" if hasattr(manifest_item, "https") and manifest_item.https else "http"
testdriver = manifest_item.testdriver if hasattr(manifest_item, "testdriver") else False
jsshell = manifest_item.jsshell if hasattr(manifest_item, "jsshell") else False
scripts = [v for (k, v) in manifest_item.source_file.script_metadata if k == b"script"]
return cls(manifest_item.source_file.tests_root,
manifest_item.url,
inherit_metadata,
@ -288,8 +286,7 @@ class TestharnessTest(Test):
path=manifest_item.source_file.path,
protocol=protocol,
testdriver=testdriver,
jsshell=jsshell,
scripts=scripts)
jsshell=jsshell)
@property
def id(self):