From f6058cb4c4eba271761754a00a1a3e1bd6a40616 Mon Sep 17 00:00:00 2001 From: Panagiotis Karalis Date: Thu, 28 Feb 2019 15:33:05 +0200 Subject: Fix the verdict of TC in sub-testcase list result When the sub-test case list is defined, in the dovetail results, each test case is appeared with the its verdict next to its name. Once a sub-testcase is passed, the verdict PASS is appeared next to the name of sub testcase. Once a sub-testcase is skipped or failed, the verdict FAIL is appeared next to the name of sub-testcase. This fix updates the code so that the verdict of skipped and failed sub test cases to be appeared respectively next to its sub-tsetcase name. JIRA: DOVETAIL-763 Change-Id: Ib05b3793a57acbaa67b89321a840ae11251c2417 Signed-off-by: Panagiotis Karalis --- dovetail/report.py | 6 ++++++ dovetail/tests/unit/test_report.py | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/dovetail/report.py b/dovetail/report.py index 44555f46..8e75c26d 100644 --- a/dovetail/report.py +++ b/dovetail/report.py @@ -551,6 +551,12 @@ class FunctestChecker(object): return True reg = sub_testcase + '$' find_reg = re.compile(reg) + for tc in result: + match = find_reg.findall(tc) + if match: + return True + reg = sub_testcase.rsplit('.', 1)[0] + find_reg = re.compile(reg) for tc in result: match = find_reg.findall(tc) if match: diff --git a/dovetail/tests/unit/test_report.py b/dovetail/tests/unit/test_report.py index 9d3acbfd..4e1214e2 100644 --- a/dovetail/tests/unit/test_report.py +++ b/dovetail/tests/unit/test_report.py @@ -1204,6 +1204,13 @@ class ReportTesting(unittest.TestCase): dt_report.FunctestChecker.get_sub_testcase('subt_a', ['subt_b', 'subt_a+'])) + def test_functest_get_sub_testcase_class_match(self): + self.assertEquals( + True, + dt_report.FunctestChecker.get_sub_testcase('subclass_a', + ['subclass_a.subt_a', + 'subclass_b.subt_b'])) + def test_functest_get_sub_no_match(self): self.assertEquals( False, -- cgit 1.2.3-korg