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

Unified Diff: scripts/slave/unittests/recipe_lint.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/unittests/recipe_configs_test.py ('k') | scripts/slave/unittests/recipe_simulation_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/unittests/recipe_lint.py
diff --git a/scripts/slave/unittests/recipe_lint.py b/scripts/slave/unittests/recipe_lint.py
index ab8ca5dd58e8407877097338c73ab807c5255535..c787853b2ac2771874bc34c2210cb24c36921e50 100755
--- a/scripts/slave/unittests/recipe_lint.py
+++ b/scripts/slave/unittests/recipe_lint.py
@@ -39,13 +39,13 @@ class TestFailure(Exception):
pass
-def ImportsTest(recipe_path, recipe_name):
+def ImportsTest(recipe_path, recipe_name, universe):
"""Tests that recipe_name only uses allowed imports.
Returns a list of errors, or an empty list if there are no errors (duh).
"""
- recipe = recipe_loader.load_recipe(recipe_name)
+ recipe = universe.load_recipe(recipe_name)
for attr in dir(recipe):
val = getattr(recipe, attr)
if isinstance(val, types.ModuleType):
@@ -60,9 +60,11 @@ def ImportsTest(recipe_path, recipe_name):
def MainTest():
+ universe = recipe_loader.RecipeUniverse()
+
errors = []
for recipe_path, recipe_name in recipe_loader.loop_over_recipes():
- errors.extend(ImportsTest(recipe_path, recipe_name))
+ errors.extend(ImportsTest(recipe_path, recipe_name, universe))
if errors:
raise TestFailure('\n'.join(map(str, errors)))
« no previous file with comments | « scripts/slave/unittests/recipe_configs_test.py ('k') | scripts/slave/unittests/recipe_simulation_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698