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

Unified Diff: scripts/slave/recipe_modules/step/api.py

Issue 24311004: Use always_run v can_fail_build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: rebase Created 7 years, 3 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: scripts/slave/recipe_modules/step/api.py
diff --git a/scripts/slave/recipe_modules/step/api.py b/scripts/slave/recipe_modules/step/api.py
index f23e7d6585947864054f0981a8d42f3af29e673e..b25aa916aaf07e29dc1a7d901a760d3bf2958409 100644
--- a/scripts/slave/recipe_modules/step/api.py
+++ b/scripts/slave/recipe_modules/step/api.py
@@ -36,6 +36,14 @@ class StepApi(recipe_api.RecipeApi):
assert 'shell' not in kwargs
assert isinstance(cmd, list)
+ if kwargs.get('abort_on_failure', False):
+ @recipe_api.wrap_followup(kwargs)
+ def assert_success(step_result):
+ if step_result.presentation.status == 'FAILURE':
+ raise recipe_api.RecipeAbort(
+ "Step(%s) failed and was marked as abort_on_failure" % name)
+ kwargs['followup_fn'] = assert_success
+
cmd = list(cmd) # Create a copy in order to not alter the input argument.
if self.auto_resolve_conflicts:
step_count = self._step_names.setdefault(name, 0) + 1

Powered by Google App Engine
This is Rietveld 408576698