| Index: third_party/recipe_engine/recipe_configs_test.py
|
| diff --git a/scripts/slave/unittests/recipe_configs_test.py b/third_party/recipe_engine/recipe_configs_test.py
|
| old mode 100755
|
| new mode 100644
|
| similarity index 90%
|
| copy from scripts/slave/unittests/recipe_configs_test.py
|
| copy to third_party/recipe_engine/recipe_configs_test.py
|
| index 6c258a98645ec59dc6c509a3f531a7b59ab02653..4c468c11fb461922fb634658156a7f1b27b2304a
|
| --- a/scripts/slave/unittests/recipe_configs_test.py
|
| +++ b/third_party/recipe_engine/recipe_configs_test.py
|
| @@ -21,20 +21,17 @@ import sys
|
| import traceback
|
| from itertools import product, imap
|
|
|
| -import test_env # "relative import" pylint: disable=W0403,W0611
|
| -
|
| -from slave import recipe_loader
|
| -from slave import recipe_util
|
| +from . import recipe_loader
|
| +from . import recipe_util
|
| +from . import recipe_config
|
|
|
| import coverage
|
|
|
| SCRIPT_PATH = os.path.abspath(os.path.dirname(__file__))
|
| SLAVE_DIR = os.path.abspath(os.path.join(SCRIPT_PATH, os.pardir))
|
|
|
| -COVERAGE = (lambda: coverage.coverage(
|
| - include=[os.path.join(x, '*', '*config.py')
|
| - for x in recipe_util.MODULE_DIRS()],
|
| - data_file='.recipe_configs_test_coverage', data_suffix=True))()
|
| +UNIVERSE = None
|
| +COVERAGE = None
|
|
|
| def covered(fn, *args, **kwargs):
|
| COVERAGE.start()
|
| @@ -43,15 +40,14 @@ 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():
|
| + for modpath in UNIVERSE.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))
|
| + modpath, local_name=modpath, base_path=os.curdir, universe=UNIVERSE))
|
| return modules
|
|
|
|
|
| @@ -60,8 +56,6 @@ def init_recipe_modules():
|
| global RECIPE_MODULES
|
| RECIPE_MODULES = covered(load_recipe_modules)
|
|
|
| -from slave import recipe_config # pylint: disable=F0401
|
| -
|
|
|
| def evaluate_configurations(args):
|
| mod_id, var_assignments = args
|
| @@ -139,7 +133,14 @@ def coverage_parallel_map(fn):
|
| pool.join()
|
|
|
|
|
| -def main():
|
| +def main(universe):
|
| + global UNIVERSE
|
| + global COVERAGE
|
| + UNIVERSE = universe
|
| + COVERAGE = coverage.coverage(
|
| + include=[os.path.join(x, '*', '*config.py')
|
| + for x in UNIVERSE.module_dirs],
|
| + data_file='.recipe_configs_test_coverage', data_suffix=True)
|
| COVERAGE.erase()
|
| init_recipe_modules()
|
|
|
|
|