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

Unified Diff: recipe_engine/step_runner.py

Issue 2913203002: [step_runner] run _merge_envs in simulation too. (Closed)
Patch Set: fix guessing 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 | recipe_modules/context/api.py » ('j') | recipe_modules/context/api.py » ('J')
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 3ef46fdbf62ded8f3938a0d3be2e0f8d9e1cb596..2f6a9672bacddb19d39d991e6edeb84f654a7809 100644
--- a/recipe_engine/step_runner.py
+++ b/recipe_engine/step_runner.py
@@ -406,6 +406,26 @@ class SubprocessStepRunner(StepRunner):
return change
+class fakeEnviron(object):
+ def __init__(self):
+ self.data = {}
+
+ def __getitem__(self, key):
+ return '<%s>' % key
+
+ def __delitem__(self, key):
+ self.data[key] = None
+
+ def __contains__(self, key):
+ return True
+
+ def __setitem__(self, key, value):
+ self.data[key] = value
+
+ def copy(self):
+ return self
+
+
class SimulationStepRunner(StepRunner):
"""Pretends to run steps, instead recording what would have been run.
@@ -430,6 +450,9 @@ class SimulationStepRunner(StepRunner):
step_test = self._test_data.pop_step_test_data(step_config.name,
test_data_fn)
rendered_step = render_step(step_config, step_test)
+ step_env = _merge_envs(fakeEnviron(), (rendered_step.config.env or {}))
+ rendered_step = rendered_step._replace(
+ config=rendered_step.config._replace(env=step_env.data))
step_config = None # Make sure we use rendered step config.
# Layer the simulation step on top of the given stream engine.
« no previous file with comments | « no previous file | recipe_modules/context/api.py » ('j') | recipe_modules/context/api.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698