From 4c5422ee52960fa151611aa94a76e363e1be98bd Mon Sep 17 00:00:00 2001 From: Klement Sekera Date: Fri, 22 Jun 2018 13:19:45 +0200 Subject: make test: fix RETRIES when setUpClass throws This change adds handling of special case when setUpClass throws. In this case TestResults receives a mock object called _ErrorHolder. By parsing its description, we find test class name and use it to lookup the test class in test suite to be able to add it to the list of failures for re-running. Change-Id: I656f21e38aa450fc567cdcbcf6e586967f947a64 Signed-off-by: Klement Sekera --- test/run_tests.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/run_tests.py') diff --git a/test/run_tests.py b/test/run_tests.py index 3476ef04668..c21acab2da5 100644 --- a/test/run_tests.py +++ b/test/run_tests.py @@ -52,7 +52,10 @@ class Filter_by_class_list: def suite_from_failed(suite, failed): filter_cb = Filter_by_class_list(failed) - return VppTestRunner.filter_tests(suite, filter_cb) + suite = VppTestRunner.filter_tests(suite, filter_cb) + if 0 == suite.countTestCases(): + raise Exception("Suite is empty after filtering out the failed tests!") + return suite def run_forked(suite): -- cgit 1.2.3-korg