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

Side by Side Diff: scripts/slave/unittests/recipe_configs_test.py

Issue 220353003: Replace recipes_test.py with a new parallel expectation-based test runner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: fix coverage race Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Provides test coverage for common recipe configurations. 6 """Provides test coverage for common recipe configurations.
7 7
8 recipe config expectations are located in ../recipe_configs_test/*.expected 8 recipe config expectations are located in ../recipe_configs_test/*.expected
9 9
10 In training mode, this will loop over every config item in ../recipe_configs.py 10 In training mode, this will loop over every config item in ../recipe_configs.py
(...skipping 15 matching lines...) Expand all
26 from slave import recipe_util 26 from slave import recipe_util
27 27
28 import coverage 28 import coverage
29 29
30 SCRIPT_PATH = os.path.abspath(os.path.dirname(__file__)) 30 SCRIPT_PATH = os.path.abspath(os.path.dirname(__file__))
31 SLAVE_DIR = os.path.abspath(os.path.join(SCRIPT_PATH, os.pardir)) 31 SLAVE_DIR = os.path.abspath(os.path.join(SCRIPT_PATH, os.pardir))
32 32
33 COVERAGE = (lambda: coverage.coverage( 33 COVERAGE = (lambda: coverage.coverage(
34 include=[os.path.join(x, '*', '*config.py') 34 include=[os.path.join(x, '*', '*config.py')
35 for x in recipe_util.MODULE_DIRS()], 35 for x in recipe_util.MODULE_DIRS()],
36 data_suffix=True))() 36 data_file='.recipe_configs_test_coverage', data_suffix=True))()
37 37
38 def covered(fn, *args, **kwargs): 38 def covered(fn, *args, **kwargs):
39 COVERAGE.start() 39 COVERAGE.start()
40 try: 40 try:
41 return fn(*args, **kwargs) 41 return fn(*args, **kwargs)
42 finally: 42 finally:
43 COVERAGE.stop() 43 COVERAGE.stop()
44 44
45 RECIPE_MODULES = None 45 RECIPE_MODULES = None
46 def init_recipe_modules(): 46 def init_recipe_modules():
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 print 'FATAL: Recipes configs are not at 100% coverage.' 146 print 'FATAL: Recipes configs are not at 100% coverage.'
147 retcode = 2 147 retcode = 2
148 148
149 test_env.print_coverage_warning() 149 test_env.print_coverage_warning()
150 150
151 return retcode 151 return retcode
152 152
153 153
154 if __name__ == '__main__': 154 if __name__ == '__main__':
155 sys.exit(main(sys.argv)) 155 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « scripts/slave/unittests/expect_tests/type_definitions.py ('k') | scripts/slave/unittests/recipe_simulation_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698