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

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

Issue 2002153008: recipe_tryjob: Actually fail on bad tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | scripts/slave/recipes/infra/recipe_roll_tryjob.expected/three_patches_fail_not_ok.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/recipe_tryjob/api.py
diff --git a/scripts/slave/recipe_modules/recipe_tryjob/api.py b/scripts/slave/recipe_modules/recipe_tryjob/api.py
index 3831273008cf2b2c2a66d6a53e67874e05b6ed15..b4dcde379ac0bbdd49db5b4903849c7dde681461 100644
--- a/scripts/slave/recipe_modules/recipe_tryjob/api.py
+++ b/scripts/slave/recipe_modules/recipe_tryjob/api.py
@@ -329,24 +329,20 @@ class RecipeTryjobApi(recipe_api.RecipeApi):
projs_to_test, locations = self._checkout_projects(
root_dir, url_mapping, deps, downstream_projects, patches)
- failures = []
- try:
- with self.m.step.defer_results():
- for proj in projs_to_test:
- deps_locs = {dep: locations[dep] for dep in deps[proj]}
-
- simulation_result = self.simulation_test(
- proj, recipe_configs[proj], locations[proj], deps_locs)
-
- try:
- simulation_result.get_result()
- except recipe_api.StepFailure as f:
- if should_fail_build_mapping.get(proj):
- failures.append(f)
- except recipe_api.AggregatedStepFailure:
- if failures:
- raise
-
-
+ bad_projects = []
+ for proj in projs_to_test:
+ deps_locs = {dep: locations[dep] for dep in deps[proj]}
+
+ try:
+ self.simulation_test(
+ proj, recipe_configs[proj], locations[proj], deps_locs)
+ except recipe_api.StepFailure:
+ if should_fail_build_mapping.get(proj, True):
+ bad_projects.append(proj)
+
+ if bad_projects:
+ raise recipe_api.StepFailure(
+ "One or more projects failed tests: %s" % (
+ ','.join(bad_projects)))
« no previous file with comments | « no previous file | scripts/slave/recipes/infra/recipe_roll_tryjob.expected/three_patches_fail_not_ok.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698