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

Unified Diff: recipe_engine/simulation_test.py

Issue 1344583003: Recipe package system. (Closed) Base URL: git@github.com:luci/recipes-py.git@master
Patch Set: Recompiled proto Created 5 years, 3 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 | « recipe_engine/run.py ('k') | recipe_engine/third_party/expect_tests/main.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_engine/simulation_test.py
diff --git a/recipe_engine/simulation_test.py b/recipe_engine/simulation_test.py
index 4a9b2cd1869c79bab82d14d01c722c7fd5028d22..39b678a3a7fad670bd1e85ca001358db47a6dfdf 100644
--- a/recipe_engine/simulation_test.py
+++ b/recipe_engine/simulation_test.py
@@ -9,7 +9,7 @@ import re
import os
import sys
-from . import expect_tests
+from .third_party import expect_tests
# This variable must be set in the dynamic scope of the functions in this file.
# We do this instead of passing because the threading system of expect tests
@@ -18,12 +18,12 @@ _UNIVERSE = None
def RunRecipe(test_data):
from .third_party import annotator
- from . import main
+ from . import run
from . import config_types
stream = annotator.StructuredAnnotationStream(stream=open(os.devnull, 'w'))
config_types.ResetTostringFns()
- result = main.run_steps(
+ result = run.run_steps(
test_data.properties, stream, _UNIVERSE, test_data)
return expect_tests.Result(list(result.steps_ran.values()))
@@ -74,14 +74,17 @@ def GenerateTests():
)
-def main(universe):
+def main(package_deps, args=None):
"""Runs simulation tests on a given repo of recipes.
Args:
- universe: a RecipeUniverse to operate on.
+ package_deps: a PackageDeps object to operate on
+ args: command line arguments to expect_tests
Returns:
Doesn't -- exits with a status code
"""
+ from . import loader
+ from . import package
# annotated_run has different behavior when these environment variables
# are set, so unset to make simulation tests environment-invariant.
@@ -93,6 +96,7 @@ def main(universe):
os.environ.pop(env_var)
global _UNIVERSE
- _UNIVERSE = universe
+ _UNIVERSE = loader.RecipeUniverse(package_deps)
+
expect_tests.main('recipe_simulation_test', GenerateTests,
- cover_omit=cover_omit())
+ cover_omit=cover_omit(), args=args)
« no previous file with comments | « recipe_engine/run.py ('k') | recipe_engine/third_party/expect_tests/main.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698