mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Generalize the 2020 regression report to show local unexpected failures
This commit is contained in:
parent
0b05b5ed87
commit
494e28bbcd
6 changed files with 48 additions and 27 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -6,7 +6,7 @@
|
||||||
/.vs
|
/.vs
|
||||||
/android-toolchains
|
/android-toolchains
|
||||||
/target
|
/target
|
||||||
/etc/layout-2020-regressions/regressions.html
|
/tests/wpt/reftests-report/report.html
|
||||||
/ports/android/bin
|
/ports/android/bin
|
||||||
/ports/android/libs
|
/ports/android/libs
|
||||||
/ports/android/local.properties
|
/ports/android/local.properties
|
||||||
|
|
|
@ -260,11 +260,11 @@ def layout_2020_regressions_report():
|
||||||
.with_dockerfile(dockerfile_path("base"))
|
.with_dockerfile(dockerfile_path("base"))
|
||||||
.with_repo_bundle()
|
.with_repo_bundle()
|
||||||
.with_script(
|
.with_script(
|
||||||
"python3 etc/layout-2020-regressions/gen.py %s %s"
|
"python3 tests/wpt/reftests-report/gen.py %s %s"
|
||||||
% (CONFIG.tree_hash(), CONFIG.git_sha)
|
% (CONFIG.tree_hash(), CONFIG.git_sha)
|
||||||
)
|
)
|
||||||
.with_index_and_artifacts_expire_in(log_artifacts_expire_in)
|
.with_index_and_artifacts_expire_in(log_artifacts_expire_in)
|
||||||
.with_artifacts("/repo/etc/layout-2020-regressions/regressions.html")
|
.with_artifacts("/repo/tests/wpt/reftests-report/report.html")
|
||||||
.find_or_create("layout-2020-regressions-report")
|
.find_or_create("layout-2020-regressions-report")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,7 @@ files = [
|
||||||
# Python 3 syntax causes "E901 SyntaxError" when flake8 runs in Python 2
|
# Python 3 syntax causes "E901 SyntaxError" when flake8 runs in Python 2
|
||||||
"./etc/taskcluster/decision_task.py",
|
"./etc/taskcluster/decision_task.py",
|
||||||
"./etc/taskcluster/decisionlib.py",
|
"./etc/taskcluster/decisionlib.py",
|
||||||
|
"./tests/wpt/reftests-report/gen.py",
|
||||||
"./components/style/properties/build.py",
|
"./components/style/properties/build.py",
|
||||||
]
|
]
|
||||||
# Directories that are ignored for the non-WPT tidy check.
|
# Directories that are ignored for the non-WPT tidy check.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
@ -41,33 +41,49 @@ def failing_reftests(platform, key):
|
||||||
|
|
||||||
for chunk in range(1, total_chunks + 1):
|
for chunk in range(1, total_chunks + 1):
|
||||||
with fetch(task(platform, chunk, key) + "/artifacts/public/test-wpt.log") as response:
|
with fetch(task(platform, chunk, key) + "/artifacts/public/test-wpt.log") as response:
|
||||||
for line in response:
|
yield from parse(response)
|
||||||
message = json.loads(line)
|
|
||||||
if message.get("status") not in {None, "OK", "PASS"}:
|
|
||||||
screenshots = message.get("extra", {}).get("reftest_screenshots")
|
|
||||||
if screenshots:
|
|
||||||
yield message["test"], screenshots
|
|
||||||
|
|
||||||
|
|
||||||
def main(index_key, commit_sha):
|
def parse(file_like):
|
||||||
failures_2013 = {url for url, _ in failing_reftests("linux_x64", index_key)}
|
seen = set()
|
||||||
failures_2020 = Directory()
|
for line in file_like:
|
||||||
for url, screenshots in failing_reftests("linux_x64_2020", index_key):
|
message = json.loads(line)
|
||||||
if url not in failures_2013:
|
status = message.get("status")
|
||||||
assert url.startswith("/")
|
if status not in {None, "OK", "PASS"}:
|
||||||
failures_2020.add(url[1:], screenshots)
|
screenshots = message.get("extra", {}).get("reftest_screenshots")
|
||||||
|
if screenshots:
|
||||||
|
url = message["test"]
|
||||||
|
assert url.startswith("/")
|
||||||
|
yield url[1:], message.get("expected") == "PASS", screenshots
|
||||||
|
|
||||||
|
|
||||||
|
def main(source, commit_sha=None):
|
||||||
|
failures = Directory()
|
||||||
|
|
||||||
|
if commit_sha:
|
||||||
|
title = "<h1>Layout 2020 regressions in commit <code>%s</code></h1>" % commit_sha
|
||||||
|
failures_2013 = {url for url, _ in failing_reftests("linux_x64", source)}
|
||||||
|
for url, _expected_pass, screenshots in failing_reftests("linux_x64_2020", source):
|
||||||
|
if url not in failures_2013:
|
||||||
|
failures.add(url, screenshots)
|
||||||
|
else:
|
||||||
|
title = "Unexpected failures"
|
||||||
|
with open(source, "rb") as file_obj:
|
||||||
|
for url, expected_pass, screenshots in parse(file_obj):
|
||||||
|
if expected_pass:
|
||||||
|
failures.add(url, screenshots)
|
||||||
|
|
||||||
here = os.path.dirname(__file__)
|
here = os.path.dirname(__file__)
|
||||||
with open(os.path.join(here, "prism.js")) as f:
|
with open(os.path.join(here, "prism.js")) as f:
|
||||||
prism_js = f.read()
|
prism_js = f.read()
|
||||||
with open(os.path.join(here, "prism.css")) as f:
|
with open(os.path.join(here, "prism.css")) as f:
|
||||||
prism_css = f.read()
|
prism_css = f.read()
|
||||||
with open(os.path.join(here, "regressions.html"), "w", encoding="utf-8") as html:
|
with open(os.path.join(here, "report.html"), "w", encoding="utf-8") as html:
|
||||||
os.chdir(os.path.join(here, "../../tests/wpt"))
|
os.chdir(os.path.join(here, ".."))
|
||||||
html.write("""
|
html.write("""
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<meta charset=utf-8>
|
<meta charset=utf-8>
|
||||||
<title>Layout 2020 regressions</title>
|
<title>WPT reftests failures report</title>
|
||||||
<link rel=stylesheet href=prism.css>
|
<link rel=stylesheet href=prism.css>
|
||||||
<style>
|
<style>
|
||||||
ul { padding-left: 1em }
|
ul { padding-left: 1em }
|
||||||
|
@ -80,11 +96,11 @@ def main(index_key, commit_sha):
|
||||||
li > div > img:hover { transform: scale(3); transform-origin: 0 0 }
|
li > div > img:hover { transform: scale(3); transform-origin: 0 0 }
|
||||||
li > div > pre { grid-row: 3; font-size: 12px !important }
|
li > div > pre { grid-row: 3; font-size: 12px !important }
|
||||||
pre code { white-space: pre-wrap !important }
|
pre code { white-space: pre-wrap !important }
|
||||||
%s
|
<h1>%s</h1>
|
||||||
</style>
|
</style>
|
||||||
<h1>Layout 2020 regressions in tree <code>%s</code></h1>
|
%s
|
||||||
""" % (prism_css, commit_sha))
|
""" % (prism_css, title))
|
||||||
failures_2020.write(html)
|
failures.write(html)
|
||||||
html.write("""
|
html.write("""
|
||||||
<script>
|
<script>
|
||||||
for (let li of document.getElementsByTagName("li")) {
|
for (let li of document.getElementsByTagName("li")) {
|
||||||
|
@ -129,11 +145,15 @@ class Directory:
|
||||||
prefix = "/_mozilla/"
|
prefix = "/_mozilla/"
|
||||||
if url.startswith(prefix):
|
if url.startswith(prefix):
|
||||||
filename = "mozilla/tests/" + url[len(prefix):]
|
filename = "mozilla/tests/" + url[len(prefix):]
|
||||||
|
elif url == "about:blank":
|
||||||
|
src = ""
|
||||||
|
filename = None
|
||||||
else:
|
else:
|
||||||
filename = "web-platform-tests" + url
|
filename = "web-platform-tests" + url
|
||||||
with open(filename, encoding="utf-8") as f:
|
if filename:
|
||||||
src = html_escape(f.read())
|
with open(filename, encoding="utf-8") as f:
|
||||||
html.write("<pre><code class=language-html>%s</code></pre>\n" % src)
|
src = html_escape(f.read())
|
||||||
|
html.write("<pre><code class=language-html>%s</code></pre>\n" % src)
|
||||||
html.write("</li>\n")
|
html.write("</li>\n")
|
||||||
html.write("</ul>\n")
|
html.write("</ul>\n")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue