summaryrefslogtreecommitdiffstats
path: root/test/run_tests.py
diff options
context:
space:
mode:
authorAndrew Yourtchenko <ayourtch@gmail.com>2021-01-14 10:19:08 +0000
committerAndrew Yourtchenko <ayourtch@gmail.com>2021-01-22 15:35:11 +0000
commit06f328129a01276858fff1086215478fa106dd8e (patch)
tree6d6c0091b4145466fdfeb8fbe6616ff1f09b4d08 /test/run_tests.py
parentb8f6122b4f4c828dee103d1f3116d27e6e3e6f3a (diff)
tests: add generalized tags for tests, use them for run-solo tests
We have accumulated several scenarios in prod or wishlists where it would be useful to have a general infra to say yes/no about a certain test, and potentially make decisions based on that, for example: - runs solo (aka 'time-dependent') - (wishlist) part of quick smoke-test set - (wishlist) intermittent failure unrelated to timing - (wishlist) test broken with a multi-worker config in vpp Refactor the current "run-solo" code to allow for this extension. Type: test Change-Id: Ia5b3810e57c0543753c8e0dc4dc0cfb4a30b36ac Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com> Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/run_tests.py')
-rw-r--r--test/run_tests.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/run_tests.py b/test/run_tests.py
index d5bdfc838df..a88a69a0eb2 100644
--- a/test/run_tests.py
+++ b/test/run_tests.py
@@ -337,7 +337,7 @@ def run_forked(testcase_suites):
while total_test_runners < concurrent_tests:
if testcase_suites:
a_suite = testcase_suites.pop(0)
- if a_suite.force_solo:
+ if a_suite.is_tagged_run_solo:
solo_testcase_suites.append(a_suite)
continue
wrapped_testcase_suite = TestCaseWrapper(a_suite,
@@ -473,7 +473,7 @@ def run_forked(testcase_suites):
results.append(TestResult(testcase_suites.pop(0)))
elif testcase_suites:
a_testcase = testcase_suites.pop(0)
- while a_testcase and a_testcase.force_solo:
+ while a_testcase and a_testcase.is_tagged_run_solo:
solo_testcase_suites.append(a_testcase)
if testcase_suites:
a_testcase = testcase_suites.pop(0)
@@ -520,10 +520,10 @@ class SplitToSuitesCallback:
self.suite_name = file_name + cls.__name__
if self.suite_name not in self.suites:
self.suites[self.suite_name] = unittest.TestSuite()
- self.suites[self.suite_name].force_solo = False
+ self.suites[self.suite_name].is_tagged_run_solo = False
self.suites[self.suite_name].addTest(test_method)
- if test_method.force_solo():
- self.suites[self.suite_name].force_solo = True
+ if test_method.is_tagged_run_solo():
+ self.suites[self.suite_name].is_tagged_run_solo = True
else:
self.filtered.addTest(test_method)