| Index: appengine/findit/waterfall/buildbot.py
|
| diff --git a/appengine/findit/waterfall/buildbot.py b/appengine/findit/waterfall/buildbot.py
|
| index 28d39db4ab0f9ee9d9348adb02abe0da31398105..d89dfc0e6998440e27341c8214a935844e36b120 100644
|
| --- a/appengine/findit/waterfall/buildbot.py
|
| +++ b/appengine/findit/waterfall/buildbot.py
|
| @@ -2,11 +2,15 @@
|
| # Use of this source code is governed by a BSD-style license that can be
|
| # found in the LICENSE file.
|
|
|
| +import contextlib
|
| from datetime import datetime
|
| +import gzip
|
| import json
|
| import re
|
| import urllib
|
|
|
| +import cloudstorage as gcs
|
| +
|
| from waterfall.build_info import BuildInfo
|
|
|
| _MASTER_URL_PATTERN = re.compile(r'^https?://build\.chromium\.org/p/([^/]+)'
|
| @@ -97,7 +101,12 @@ def CreateStdioLogUrl(master_name, builder_name, build_number, step_name):
|
| master_name, builder_name, build_number, step_name)
|
|
|
|
|
| -def GetBuildDataFromBuildMaster(master_name,
|
| +def CreateGtestResultPath(master_name, builder_name, build_number, step_name):
|
| + return ('/chrome-gtest-results/buildbot/%s/%s/%s/%s.json.gz') % (
|
| + master_name, builder_name, build_number, step_name)
|
| +
|
| +
|
| +def GetBuildDataFromBuildMaster(master_name,
|
| builder_name, build_number, http_client):
|
| """Returns the json-format data of the build from buildbot json API."""
|
| status_code, data = http_client.Get(
|
| @@ -108,7 +117,7 @@ def GetBuildDataFromBuildMaster(master_name,
|
| return data
|
|
|
|
|
| -def GetBuildDataFromArchive(master_name,
|
| +def GetBuildDataFromArchive(master_name,
|
| builder_name, build_number, http_client):
|
| """Returns the json-format data of the build from build archive."""
|
| status_code, data = http_client.Get(
|
| @@ -130,6 +139,19 @@ def GetStepStdio(master_name, builder_name, build_number,
|
| return data
|
|
|
|
|
| +def GetGtestResultLog(
|
| + master_name, builder_name, build_number, step_name): # pragma: no cover
|
| + """Returns the content of the gtest json results for the gtest-based step."""
|
| + try:
|
| + archived_log_path = CreateGtestResultPath(
|
| + master_name, builder_name, build_number, step_name)
|
| + with contextlib.closing(gcs.open(archived_log_path)) as gtest_result_file:
|
| + with gzip.open(gtest_result_file) as unzipped_gtest_result_file:
|
| + return unzipped_gtest_result_file.read()
|
| + except gcs.NotFoundError:
|
| + return None
|
| +
|
| +
|
| def GetStepResult(step_data_json):
|
| """Returns the result of a step."""
|
| result = step_data_json.get('results')
|
|
|