| Index: third_party/WebKit/LayoutTests/external/wpt/check_stability.py
|
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/check_stability.py b/third_party/WebKit/LayoutTests/external/wpt/check_stability.py
|
| index b8ede389240fb76943e670c1081b4b43e437559b..a7431c8a1c661b3835e57b09a2e7e02d3081cc30 100644
|
| --- a/third_party/WebKit/LayoutTests/external/wpt/check_stability.py
|
| +++ b/third_party/WebKit/LayoutTests/external/wpt/check_stability.py
|
| @@ -89,14 +89,14 @@ class TravisFold(object):
|
|
|
|
|
| class GitHub(object):
|
| - def __init__(self, org, repo, token, browser):
|
| + def __init__(self, org, repo, token, product):
|
| self.token = token
|
| self.headers = {"Accept": "application/vnd.github.v3+json"}
|
| self.auth = (self.token, "x-oauth-basic")
|
| self.org = org
|
| self.repo = repo
|
| self.base_url = "https://api.github.com/repos/%s/%s/" % (org, repo)
|
| - self.browser = browser
|
| + self.product = product
|
|
|
| def _headers(self, headers):
|
| if headers is None:
|
| @@ -145,7 +145,7 @@ class GitHub(object):
|
| user = self.get(urljoin(self.base_url, "/user")).json()
|
| issue_comments_url = urljoin(self.base_url, "issues/%s/comments" % issue_number)
|
| comments = self.get(issue_comments_url).json()
|
| - title_line = "# %s #" % self.browser.title()
|
| + title_line = format_comment_title(self.product)
|
| data = {"body": body}
|
| for comment in comments:
|
| if (comment["user"]["login"] == user["login"] and
|
| @@ -156,10 +156,6 @@ class GitHub(object):
|
| else:
|
| self.post(issue_comments_url, data)
|
|
|
| - def releases(self):
|
| - url = urljoin(self.base_url, "releases/latest")
|
| - return self.get(url)
|
| -
|
|
|
| class GitHubCommentHandler(logging.Handler):
|
| def __init__(self, github, pull_number):
|
| @@ -237,10 +233,9 @@ class Chrome(Browser):
|
| product = "chrome"
|
|
|
| def install(self):
|
| - latest = get("https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2FLAST_CHANGE?alt=media").text.strip()
|
| - url = "https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%%2F%s%%2Fchrome-linux.zip?alt=media" % latest
|
| - unzip(get(url).raw)
|
| - logger.debug(call("ls", "-lhrt", "chrome-linux"))
|
| + # Installing the Google Chrome browser requires administrative
|
| + # privileges, so that installation is handled by the invoking script.
|
| +
|
| call("pip", "install", "-r", os.path.join("w3c", "wptrunner", "requirements_chrome.txt"))
|
|
|
| def install_webdriver(self):
|
| @@ -253,7 +248,13 @@ class Chrome(Browser):
|
| def wptrunner_args(self, root):
|
| return {
|
| "product": "chrome",
|
| - "binary": "%s/chrome-linux/chrome" % root,
|
| + "binary": "/usr/bin/google-chrome",
|
| + # Chrome's "sandbox" security feature must be disabled in order to
|
| + # run the browser in OpenVZ environments such as the one provided
|
| + # by TravisCI.
|
| + #
|
| + # Reference: https://github.com/travis-ci/travis-ci/issues/938
|
| + "binary_arg": "--no-sandbox",
|
| "webdriver_binary": "%s/chromedriver" % root,
|
| "test_types": ["testharness", "reftest"]
|
| }
|
| @@ -318,7 +319,7 @@ def unzip(fileobj):
|
| def setup_github_logging(args):
|
| gh_handler = None
|
| if args.comment_pr:
|
| - github = GitHub("w3c", "web-platform-tests", args.gh_token, args.browser)
|
| + github = GitHub("w3c", "web-platform-tests", args.gh_token, args.product)
|
| try:
|
| pr_number = int(args.comment_pr)
|
| except ValueError:
|
| @@ -492,6 +493,21 @@ def process_results(log, iterations):
|
| return results, inconsistent
|
|
|
|
|
| +def format_comment_title(product):
|
| + """Produce a Markdown-formatted string based on a given "product"--a string
|
| + containing a browser identifier optionally followed by a colon and a
|
| + release channel. (For example: "firefox" or "chrome:dev".) The generated
|
| + title string is used both to create new comments and to locate (and
|
| + subsequently update) previously-submitted comments."""
|
| + parts = product.split(":")
|
| + title = parts[0].title()
|
| +
|
| + if len(parts) > 1:
|
| + title += " (%s channel)" % parts[1]
|
| +
|
| + return "# %s #" % title
|
| +
|
| +
|
| def markdown_adjust(s):
|
| s = s.replace('\t', u'\\t')
|
| s = s.replace('\n', u'\\n')
|
| @@ -570,9 +586,9 @@ def get_parser():
|
| action="store",
|
| default=os.environ.get("TRAVIS_PULL_REQUEST"),
|
| help="PR to comment on with stability results")
|
| - parser.add_argument("browser",
|
| + parser.add_argument("product",
|
| action="store",
|
| - help="Browser to run against")
|
| + help="Product to run against (`browser-name` or 'browser-name:channel')")
|
| return parser
|
|
|
|
|
| @@ -593,13 +609,15 @@ def main():
|
| logger.warning("Can't log to GitHub")
|
| gh_handler = None
|
|
|
| + browser_name = args.product.split(":")[0]
|
| +
|
| with TravisFold("browser_setup"):
|
| - logger.info("# %s #" % args.browser.title())
|
| + logger.info(format_comment_title(args.product))
|
|
|
| browser_cls = {"firefox": Firefox,
|
| - "chrome": Chrome}.get(args.browser)
|
| + "chrome": Chrome}.get(browser_name)
|
| if browser_cls is None:
|
| - logger.critical("Unrecognised browser %s" % args.browser)
|
| + logger.critical("Unrecognised browser %s" % browser_name)
|
| return 1
|
|
|
| fetch_wpt_master()
|
|
|