summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2016-10-14 15:45:50 -0700
committerDylan Baker <dylan@pnwbakers.com>2016-11-10 10:51:02 -0800
commit3a0192faab0afaab24bafef795fbf6b65dafb36a (patch)
treec1b2294a42186373d0e2d73eb5f41180a13589c5 /framework
parent56f8ba1f9276ddd02669f630c40005838258840a (diff)
framework: Remove exclude_tests from options.OPTIONS
Rather than putting this in a global variable, just add a filter for this in the runner. Far simpler, and removes more globals. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/options.py1
-rw-r--r--framework/profile.py1
-rw-r--r--framework/programs/run.py5
3 files changed, 4 insertions, 3 deletions
diff --git a/framework/options.py b/framework/options.py
index 46e37eecf..dc97c382b 100644
--- a/framework/options.py
+++ b/framework/options.py
@@ -189,7 +189,6 @@ class _Options(object): # pylint: disable=too-many-instance-attributes
self.execute = True
self._include_filter = _ReList()
self._exclude_filter = _ReList()
- self.exclude_tests = set()
self.valgrind = False
self.dmesg = False
self.monitored = False
diff --git a/framework/profile.py b/framework/profile.py
index e016a3689..e00fbc4d7 100644
--- a/framework/profile.py
+++ b/framework/profile.py
@@ -260,7 +260,6 @@ class TestProfile(object):
"""Filter for user-specified restrictions"""
return ((not options.OPTIONS.include_filter or
matches_any_regexp(path, options.OPTIONS.include_filter))
- and path not in options.OPTIONS.exclude_tests
and not matches_any_regexp(path, options.OPTIONS.exclude_filter))
filters = self.filters + [test_matches]
diff --git a/framework/programs/run.py b/framework/programs/run.py
index fa12c09a2..20a036e2a 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -391,9 +391,10 @@ def resume(input_):
# Don't re-run tests that have already completed, incomplete status tests
# have obviously not completed.
+ exclude_tests = set()
for name, result in six.iteritems(results.tests):
if args.no_retry or result.result != 'incomplete':
- options.OPTIONS.exclude_tests.add(name)
+ exclude_tests.add(name)
profiles = [profile.load_test_profile(p)
for p in results.options['profile']]
@@ -406,6 +407,8 @@ def resume(input_):
if options.OPTIONS.monitored:
p.monitoring = options.OPTIONS.monitored
+ p.filters.append(lambda n, _: n not in exclude_tests)
+
# This is resumed, don't bother with time since it won't be accurate anyway
profile.run(
profiles,