[Piglit] [PATCH v3 4/28] framework: remove concurrent from OPTIONS, pass directly to profile
Dylan Baker
dylan at pnwbakers.com
Mon Oct 31 17:50:00 UTC 2016
This removes a value out of the global OPTIONS, which is nice. It's very
trivial to pass this instead of putting it in options.
Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
framework/options.py | 2 --
framework/profile.py | 2 +-
framework/programs/run.py | 11 +++++++----
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/framework/options.py b/framework/options.py
index 5cb88aa..46e37ee 100644
--- a/framework/options.py
+++ b/framework/options.py
@@ -171,7 +171,6 @@ class _Options(object): # pylint: disable=too-many-instance-attributes
the configuration file.
Options are as follows:
- concurrent -- one of: ["all", "some", "none"]. Default: "some"
execute -- False for dry run
include_filter -- list of compiled regex which include exclusively tests
that match
@@ -187,7 +186,6 @@ class _Options(object): # pylint: disable=too-many-instance-attributes
exclude_filter = _ReListDescriptor('_exclude_filter', type_=_FilterReList)
def __init__(self):
- self.concurrent = "some"
self.execute = True
self._include_filter = _ReList()
self._exclude_filter = _ReList()
diff --git a/framework/profile.py b/framework/profile.py
index 1b9448f..6404904 100644
--- a/framework/profile.py
+++ b/framework/profile.py
@@ -448,7 +448,7 @@ def merge_test_profiles(profiles):
return profile
-def run(profile, logger, backend):
+def run(profile, logger, backend, concurrency):
"""Runs all tests using Thread pool.
When called this method will flatten out self.tests into self.test_list,
diff --git a/framework/programs/run.py b/framework/programs/run.py
index 023aa2e..c01b9b5 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -222,6 +222,7 @@ def _create_metadata(args, name):
opts = dict(options.OPTIONS)
opts['profile'] = args.test_profile
opts['log_level'] = args.log_level
+ opts['concurrent'] = args.concurrent
if args.platform:
opts['platform'] = args.platform
@@ -276,7 +277,6 @@ def run(input_):
args.concurrency = "none"
# Pass arguments into Options
- options.OPTIONS.concurrent = args.concurrency
options.OPTIONS.exclude_filter = args.exclude_tests
options.OPTIONS.include_filter = args.include_tests
options.OPTIONS.execute = args.execute
@@ -336,7 +336,7 @@ def run(input_):
if args.monitored:
profile.monitoring = args.monitored
- framework.profile.run(profile, args.log_level, backend)
+ framework.profile.run(profile, args.log_level, backend, args.concurrent)
results.time_elapsed.end = time.time()
backend.finalize({'time_elapsed': results.time_elapsed.to_json()})
@@ -365,7 +365,6 @@ def resume(input_):
_disable_windows_exception_messages()
results = backends.load(args.results_path)
- options.OPTIONS.concurrent = results.options['concurrent']
options.OPTIONS.exclude_filter = results.options['exclude_filter']
options.OPTIONS.include_filter = results.options['include_filter']
options.OPTIONS.execute = results.options['execute']
@@ -404,7 +403,11 @@ def resume(input_):
profile.monitoring = options.OPTIONS.monitored
# This is resumed, don't bother with time since it won't be accurate anyway
- framework.profile.run(profile, results.options['log_level'], backend)
+ framework.profile.run(
+ profile,
+ results.options['log_level'],
+ backend,
+ results.options['concurrent'])
backend.finalize()
--
git-series 0.8.10
More information about the Piglit
mailing list