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

Unified Diff: recipe_engine/step_runner.py

Issue 2885023004: [step_runner] Add a Placeholder Exception step when rendering placeholders raises a StepFailure. (Closed)
Patch Set: fix nits Created 3 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 | recipes/engine_tests/step_stack_exhaustion.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/step_runner.py
diff --git a/recipe_engine/step_runner.py b/recipe_engine/step_runner.py
index a3cc100fb868a7fd5fb572ddfc79062d96b4fc7d..542ac26dde97c928b37107f99b55bc013e5ae84f 100644
--- a/recipe_engine/step_runner.py
+++ b/recipe_engine/step_runner.py
@@ -172,10 +172,16 @@ class SubprocessStepRunner(StepRunner):
return EmptyOpenStep()
- rendered_step = render_step(
- step_config, recipe_test_api.DisabledTestData()
- )
- step_config = None # Make sure we use rendered step config.
+ try:
+ rendered_step = render_step(
+ step_config, recipe_test_api.DisabledTestData()
+ )
+ step_config = None # Make sure we use rendered step config.
+ except:
+ with self.stream_engine.make_step_stream('Placeholder Exception') as s:
+ with s.new_log_stream('exception') as l:
+ l.write_split(traceback.format_exc())
+ raise
step_env = _merge_envs(os.environ, (rendered_step.config.env or {}))
# Now that the step's environment is all sorted, evaluate PATH on windows
@@ -410,11 +416,17 @@ class SimulationStepRunner(StepRunner):
return self._stream_engine
def open_step(self, step_config):
- test_data_fn = step_config.step_test_data or recipe_test_api.StepTestData
- step_test = self._test_data.pop_step_test_data(step_config.name,
- test_data_fn)
- rendered_step = render_step(step_config, step_test)
- step_config = None # Make sure we use rendered step config.
+ try:
+ test_data_fn = step_config.step_test_data or recipe_test_api.StepTestData
+ step_test = self._test_data.pop_step_test_data(step_config.name,
+ test_data_fn)
+ rendered_step = render_step(step_config, step_test)
+ step_config = None # Make sure we use rendered step config.
+ except:
+ with self.stream_engine.make_step_stream('Placeholder Exception') as s:
+ with s.new_log_stream('exception') as l:
+ l.write_split(traceback.format_exc())
+ raise
# Layer the simulation step on top of the given stream engine.
step_stream = self._stream_engine.new_step_stream(rendered_step.config)
« no previous file with comments | « no previous file | recipes/engine_tests/step_stack_exhaustion.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698