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

Unified Diff: recipe_engine/unittests/run_test.py

Issue 2933473002: [context] Split "env" values and prefixes. (Closed)
Patch Set: comments Created 3 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
Index: recipe_engine/unittests/run_test.py
diff --git a/recipe_engine/unittests/run_test.py b/recipe_engine/unittests/run_test.py
index 7249493c00ff42fc4016e24ae09ef11a418ecd24..dd767c1777303c1e17f6583ab0bb3988f966dd33 100755
--- a/recipe_engine/unittests/run_test.py
+++ b/recipe_engine/unittests/run_test.py
@@ -44,17 +44,27 @@ class RunTest(unittest.TestCase):
finally:
os.environ[requests_ssl.ENV_VAR_IGNORE] = prev_ignore
- def _test_recipe(self, recipe, properties=None):
+ def _test_recipe(self, recipe, properties=None, env=None):
proc = subprocess.Popen(
self._run_cmd(recipe, properties),
stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
+ stderr=subprocess.STDOUT,
+ env=env)
stdout = proc.communicate()
self.assertEqual(0, proc.returncode, '%d != %d when testing %s:\n%s' % (
0, proc.returncode, recipe, stdout))
def test_examples(self):
+ env = os.environ.copy()
+
+ # Set the "RECIPE_ENGINE_CONTEXT_TEST" enviornment variable to a known
+ # value, "default". This is used by the "context:tests/env" recipe module
+ # as a basis for runtime tests.
+ env['RECIPE_ENGINE_CONTEXT_TEST'] = 'default'
+
tests = [
+ ['context:examples/full'],
+ ['context:tests/env'],
['step:examples/full'],
['path:examples/full'],
['raw_io:examples/full'],
@@ -68,7 +78,7 @@ class RunTest(unittest.TestCase):
['engine_tests/functools_partial'],
]
for test in tests:
- self._test_recipe(*test)
+ self._test_recipe(*test, env=env)
def test_bad_subprocess(self):
now = time.time()

Powered by Google App Engine
This is Rietveld 408576698