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

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: Created 6 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: 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 c0622072c5dfd07ba89c7209cf4d8005e644bb7d..7c272e8f96c8a129adf48a1f0d5e40de71f56f9e 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):
M-A Ruel 2014/06/04 00:52:53 Side note: it's interesting because in the last CL
Vadim Sh. 2014/06/04 02:58:26 I've realized I need to pass crapload of additiona
"""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,14 @@ 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.
+ if 'abort_on_failure' not in kwargs:
M-A Ruel 2014/06/04 00:52:53 What you want is: kwargs.setdefault('abort_on_fail
Vadim Sh. 2014/06/04 02:58:26 Done.
+ kwargs['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 +77,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 +85,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') | scripts/slave/recipe_modules/swarming/api.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698