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

Unified Diff: scripts/slave/remote_run.py

Issue 2133573004: remote_run: make build purple on any infra failures (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: pylint Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/remote_run.py
diff --git a/scripts/slave/remote_run.py b/scripts/slave/remote_run.py
index a409a3eb890814d89c3a9143e249e06e53fdb185..c19162aa5d3f0289946114434271b85962028ed0 100644
--- a/scripts/slave/remote_run.py
+++ b/scripts/slave/remote_run.py
@@ -18,6 +18,7 @@ BUILD_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))))
sys.path.insert(0, os.path.join(BUILD_ROOT, 'scripts'))
+from common import annotator
from common import chromium_utils
from common import env
from slave import cipd
@@ -118,6 +119,7 @@ def main(argv):
monitoring_utils.write_build_monitoring_event(build_data_dir, properties)
+ recipe_result_path = os.path.join(tempdir, 'recipe_result.json')
recipe_cmd = [
sys.executable,
os.path.join(cipd_path, 'recipes.py'),
@@ -131,6 +133,7 @@ def main(argv):
'run',
'--properties-file', properties_file,
'--workdir', os.path.join(tempdir, 'w'),
+ '--output-result-json', recipe_result_path,
args.recipe,
]
# If we bootstrap through logdog, the recipe command line gets written
@@ -154,6 +157,11 @@ def main(argv):
if recipe_return_code is None:
LOGGER.info('Not using LogDog. Invoking `recipes.py` directly.')
recipe_return_code = _call(recipe_cmd)
+
+ # Try to open recipe result JSON. Any failure will result in an exception
+ # and an infra failure.
+ with open(recipe_result_path) as f:
+ json.load(f)
return recipe_return_code
@@ -165,7 +173,9 @@ def shell_main(argv):
# Re-execute with the updated remote_run.py.
return _call([sys.executable] + argv)
- return main(argv)
+ stream = annotator.StructuredAnnotationStream()
+ with stream.step('remote_run_result'):
martiniss 2016/07/08 21:10:29 Why is this here? You're creating another step bef
Paweł Hajdan Jr. 2016/07/11 11:21:07 Yes, this way I can turn that step purple e.g. on
+ return main(argv)
if __name__ == '__main__':
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698