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

Unified Diff: scripts/slave/unittests/recipe_configs_test.py

Issue 1111413005: Some changes to allow recipes and modules to live noncentrally (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Review comments Created 5 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 | « scripts/slave/recipes/chromium_gn.py ('k') | scripts/slave/unittests/recipe_lint.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/unittests/recipe_configs_test.py
diff --git a/scripts/slave/unittests/recipe_configs_test.py b/scripts/slave/unittests/recipe_configs_test.py
index 073f40833525cbe71f75f61756c60dad997c6f75..6c258a98645ec59dc6c509a3f531a7b59ab02653 100755
--- a/scripts/slave/unittests/recipe_configs_test.py
+++ b/scripts/slave/unittests/recipe_configs_test.py
@@ -43,18 +43,29 @@ def covered(fn, *args, **kwargs):
finally:
COVERAGE.stop()
+UNIVERSE = recipe_loader.RecipeUniverse()
+
+def load_recipe_modules():
+ modules = {}
+ for modpath in recipe_loader.loop_over_recipe_modules():
+ # That's right, we're using the path as the local name! The local
+ # name really could be anything unique, we don't use it.
+ modules[modpath] = UNIVERSE.load(recipe_loader.PathDependency(
+ modpath, local_name=modpath, base_path=os.curdir))
+ return modules
+
+
RECIPE_MODULES = None
def init_recipe_modules():
global RECIPE_MODULES
- RECIPE_MODULES = covered(recipe_loader.load_recipe_modules,
- recipe_util.MODULE_DIRS())
+ RECIPE_MODULES = covered(load_recipe_modules)
from slave import recipe_config # pylint: disable=F0401
def evaluate_configurations(args):
mod_id, var_assignments = args
- mod = getattr(RECIPE_MODULES, mod_id)
+ mod = RECIPE_MODULES[mod_id]
ctx = mod.CONFIG_CTX
config_name = None
@@ -91,8 +102,6 @@ def evaluate_configurations(args):
def multiprocessing_init():
- init_recipe_modules()
-
# HACK: multiprocessing doesn't work with atexit, so shim the exit functions
# instead. This allows us to save exactly one coverage file per subprocess.
# pylint: disable=W0212
@@ -112,8 +121,8 @@ def multiprocessing_init():
def coverage_parallel_map(fn):
combination_generator = (
(mod_id, var_assignments)
- for mod_id, mod in RECIPE_MODULES.__dict__.iteritems()
- if mod_id[0] != '_' and mod.CONFIG_CTX
+ for mod_id, mod in RECIPE_MODULES.iteritems()
+ if mod.CONFIG_CTX
for var_assignments in imap(dict, product(*[
[(key_name, val) for val in vals]
for key_name, vals in mod.CONFIG_CTX.VAR_TEST_MAP.iteritems()
« no previous file with comments | « scripts/slave/recipes/chromium_gn.py ('k') | scripts/slave/unittests/recipe_lint.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698