[v2,4/26] framework: remove concurrent from OPTIONS, pass directly to profile

Submitted by Dylan Baker on Oct. 27, 2016, 9:31 p.m.

Details

Message ID ec979b7b41a2f835486ffe2decb473a22fb12965.1477603560.git-series.dylan@pnwbakers.com
State New
Headers show

Not browsing as part of any series.

Patch hide | download patch | download mbox

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 b10f817..821a630 100644
--- a/framework/profile.py
+++ b/framework/profile.py
@@ -442,7 +442,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()