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

Unified Diff: scripts/slave/annotated_run.py

Issue 23889036: Refactor the way that TestApi works so that it is actually useful. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Move gclient test_api to got_revisions cl 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
« no previous file with comments | « no previous file | scripts/slave/recipe_api.py » ('j') | scripts/slave/recipe_api.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/annotated_run.py
diff --git a/scripts/slave/annotated_run.py b/scripts/slave/annotated_run.py
index e8840a870206d70d382ebf76466ca3510417934d..0e44356e68b9965a4a815beef79309af6b9bba38 100755
--- a/scripts/slave/annotated_run.py
+++ b/scripts/slave/annotated_run.py
@@ -382,8 +382,8 @@ def run_steps(stream, build_properties, factory_properties,
properties = factory_properties.copy()
properties.update(build_properties)
stream.emit('Running recipe with %s' % (properties,))
- steps = recipe_module.GenSteps(api(recipe_module.DEPS,
- mod_dirs=MODULE_DIRS,
+ steps = recipe_module.GenSteps(api(MODULE_DIRS,
+ recipe_module.DEPS,
properties=properties,
step_history=step_history))
assert inspect.isgenerator(steps)
@@ -400,7 +400,12 @@ def run_steps(stream, build_properties, factory_properties,
step_history[step['name']] = step_result
continue
- test_data_item = test_data.pop(step['name'], {}) if test_mode else None
+ test_data_item = None
+ mock_fn = step.pop('mock_fn', None)
+ if test_mode:
+ test_data_item = mock_fn() if mock_fn else {}
+ test_data_item.update(test_data.pop(step['name'], {}))
+
placeholders = render_step(step, test_data_item)
assert step['name'] not in step_history, (
« no previous file with comments | « no previous file | scripts/slave/recipe_api.py » ('j') | scripts/slave/recipe_api.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698