Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1819)

Unified Diff: appengine/findit/waterfall/buildbot.py

Issue 1149743002: [Findit] Use step level analysis to exclude flaky test failures. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Fix name style nit. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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')
« no previous file with comments | « appengine/findit/waterfall/analyze_build_failure_pipeline.py ('k') | appengine/findit/waterfall/extract_signal_pipeline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698