Fix test results
In a rare case a failure can occur in a VppTestCase which hasn't been
part of the original TestSuite, such as in memif testcases. Fix the
reporting after test run in these cases.
@@ -87,10 +87,6 @@ class TestResult(dict):
return suite_from_failed(self.testcase_suite, rerun_ids)
def get_testcase_names(self, test_id):
- if re.match(r'.+\..+\..+', test_id):
- test_name = self._get_test_description(test_id)
- testcase_name = self._get_testcase_doc_name(test_id)
- else:
# could be tearDownClass (test_ipsec_esp.TestIpsecEsp1)
setup_teardown_match = re.match(
r'((tearDownClass)|(setUpClass)) \((.+\..+)\)', test_id)
@@ -103,17 +99,25 @@ class TestResult(dict):
break
testcase_name = self._get_testcase_doc_name(testcase_name)
else:
- test_name = test_id
- testcase_name = test_id
+ test_name = self._get_test_description(test_id)
+ testcase_name = self._get_testcase_doc_name(test_id)
return testcase_name, test_name
def _get_test_description(self, test_id):
- return get_test_description(descriptions,
+ if test_id in self.testcases_by_id:
+ desc = get_test_description(descriptions,
self.testcases_by_id[test_id])
+ else:
+ desc = test_id
+ return desc
def _get_testcase_doc_name(self, test_id):
- return get_testcase_doc_name(self.testcases_by_id[test_id])
+ if test_id in self.testcases_by_id:
+ doc_name = get_testcase_doc_name(self.testcases_by_id[test_id])
+ else:
+ doc_name = test_id
+ return doc_name
def test_runner_wrapper(suite, keep_alive_pipe, stdouterr_queue,
