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

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

Issue 313693003: Swarming: conditionally run tests on swarming in chromium_trybot recipe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: rebase Created 6 years, 6 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/recipe_modules/isolate/test_api.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/isolate/api.py
diff --git a/scripts/slave/recipe_modules/isolate/api.py b/scripts/slave/recipe_modules/isolate/api.py
index 5f647262e6abb688071a36dd756b3a6e2307381d..8f2f8b8d97713bac0ef160f81888837331744fc6 100644
--- a/scripts/slave/recipe_modules/isolate/api.py
+++ b/scripts/slave/recipe_modules/isolate/api.py
@@ -38,7 +38,7 @@ class IsolateApi(recipe_api.RecipeApi):
config.gyp_env.GYP_DEFINES['test_isolation_mode'] = 'archive'
config.gyp_env.GYP_DEFINES['test_isolation_outdir'] = self._isolate_server
- def find_isolated_tests(self, build_dir, targets=None):
+ def find_isolated_tests(self, build_dir, targets=None, **kwargs):
"""Returns a step which finds all *.isolated files in a build directory.
Assigns the dict {target name -> *.isolated file hash} to the swarm_hashes
@@ -48,7 +48,13 @@ class IsolateApi(recipe_api.RecipeApi):
If |targets| is None, the step will use all *.isolated files it finds.
Otherwise, it will verify that all |targets| are found and will use only
them. If some expected targets are missing, will abort the build.
+
+ Also accepts step execution controlling flags (always_run, can_fail_build,
+ etc.) via kwargs.
"""
+ # Failure is fatal by default.
+ kwargs.setdefault('abort_on_failure', True)
+
def followup_fn(step_result):
assert isinstance(step_result.json.output, dict)
self._isolated_tests = step_result.json.output
@@ -70,6 +76,7 @@ class IsolateApi(recipe_api.RecipeApi):
if (not self._isolated_tests and
step_result.presentation.status != 'FAILURE'):
step_result.presentation.status = 'WARNING'
+
return self.m.python(
'find isolated tests',
self.resource('find_isolated_tests.py'),
@@ -77,9 +84,9 @@ class IsolateApi(recipe_api.RecipeApi):
'--build-dir', build_dir,
'--output-json', self.m.json.output(),
],
- abort_on_failure=True,
followup_fn=followup_fn,
- step_test_data=lambda: (self.test_api.output_json(targets)))
+ step_test_data=lambda: (self.test_api.output_json(targets)),
+ **kwargs)
@property
def isolated_tests(self):
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/isolate/test_api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698