Commit f17d0f99 authored by Robert Ma's avatar Robert Ma Committed by Commit Bot

[blinkpy] Roll WPT tools to 8b1df3d520335fb42ef4bfd50b9121ac41995f8e

from c808aa3d15a42648d8b25a838024813990959e37

Change-Id: Ibec6a32fc4994773b728214ce9c1ab944dd00e85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2495242
Commit-Queue: Robert Ma <robertma@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Auto-Submit: Robert Ma <robertma@chromium.org>
Reviewed-by: default avatarStephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820274}
parent dd300217
...@@ -22,7 +22,7 @@ Local Modifications: None ...@@ -22,7 +22,7 @@ Local Modifications: None
Name: web-platform-tests - Test Suites for Web Platform specifications Name: web-platform-tests - Test Suites for Web Platform specifications
Short Name: wpt Short Name: wpt
URL: https://github.com/web-platform-tests/wpt/ URL: https://github.com/web-platform-tests/wpt/
Version: c808aa3d15a42648d8b25a838024813990959e37 Version: 8b1df3d520335fb42ef4bfd50b9121ac41995f8e
License: LICENSES FOR W3C TEST SUITES (https://www.w3.org/Consortium/Legal/2008/03-bsd-license.html) License: LICENSES FOR W3C TEST SUITES (https://www.w3.org/Consortium/Legal/2008/03-bsd-license.html)
License File: wpt/wpt/LICENSE.md License File: wpt/wpt/LICENSE.md
Security Critical: no Security Critical: no
......
...@@ -9,7 +9,7 @@ cd $DIR ...@@ -9,7 +9,7 @@ cd $DIR
TARGET_DIR=$DIR/wpt TARGET_DIR=$DIR/wpt
REMOTE_REPO="https://github.com/web-platform-tests/wpt.git" REMOTE_REPO="https://github.com/web-platform-tests/wpt.git"
WPT_HEAD=c808aa3d15a42648d8b25a838024813990959e37 WPT_HEAD=8b1df3d520335fb42ef4bfd50b9121ac41995f8e
function clone { function clone {
# Remove existing repo if already exists. # Remove existing repo if already exists.
......
import io
from six import ensure_text
MYPY = False MYPY = False
if MYPY: if MYPY:
# MYPY is set to True when run under Mypy. # MYPY is set to True when run under Mypy.
from typing import Any from typing import AnyStr, Optional, Text
from typing import Optional
from typing import Text
class GitHubChecksOutputter(object): class GitHubChecksOutputter(object):
"""Provides a method to output data to be shown in the GitHub Checks UI. """Provides a method to output data to be shown in the GitHub Checks UI.
...@@ -12,23 +14,27 @@ class GitHubChecksOutputter(object): ...@@ -12,23 +14,27 @@ class GitHubChecksOutputter(object):
to enable developers to quickly understand what has gone wrong. The output to enable developers to quickly understand what has gone wrong. The output
supports markdown format. supports markdown format.
See https://docs.taskcluster.net/docs/reference/integrations/github/checks#custom-text-output-in-checks https://docs.taskcluster.net/docs/reference/integrations/github/checks#custom-text-output-in-checks
""" """
def __init__(self, path): def __init__(self, path):
# type: (Text) -> None # type: (Text) -> None
self.path = path self.path = path
def output(self, line): def output(self, line):
# type: (Any) -> None # type: (AnyStr) -> None
# TODO(stephenmcgruer): Once mypy 0.790 is released, we can change this text = ensure_text(line)
# to AnyStr, as that release teaches mypy about the mode flags of open. # NOTE: mypy types the "text mode" of open() in Python 2 as BinaryIO,
# See https://github.com/python/typeshed/pull/4146 # which makes sense as we cannot specify its encoding (it's
with open(self.path, 'a') as f: # platform-dependent), while io.open() is closer to open() in Python 3.
f.write(line) # TODO: use the built-in open() when we are Py3-only.
f.write('\n') with io.open(self.path, mode="a") as f:
f.write(text)
f.write(u"\n")
__outputter = None __outputter = None
def get_gh_checks_outputter(filepath): def get_gh_checks_outputter(filepath):
# type: (Optional[Text]) -> Optional[GitHubChecksOutputter] # type: (Optional[Text]) -> Optional[GitHubChecksOutputter]
"""Return the outputter for GitHub Checks output, if enabled. """Return the outputter for GitHub Checks output, if enabled.
......
...@@ -152,7 +152,7 @@ def repo_files_changed(revish, include_uncommitted=False, include_new=False): ...@@ -152,7 +152,7 @@ def repo_files_changed(revish, include_uncommitted=False, include_new=False):
assert not entries[-1] assert not entries[-1]
entries = entries[:-1] entries = entries[:-1]
for item in entries: for item in entries:
status, path = item.split() status, path = item.split(" ", 1)
if status == "??" and not include_new: if status == "??" and not include_new:
continue continue
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment