From: xudan Date: Wed, 13 Dec 2017 07:00:34 +0000 (-0500) Subject: [Bugfix] Local summary with wrong results when Tempest failed at the SetupClass X-Git-Tag: ovp-2.0.0-rc1~146 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=cb03da10feb8af4cd48add8ab96b134f6d6ebd1c;p=dovetail.git [Bugfix] Local summary with wrong results when Tempest failed at the SetupClass When Tempest test cases failed at the SetupClass, the record is the class name of the test cases rather than the name of the test cases. The local summary will say they are passed wrongly. JIRA: DOVETAIL-575 Change-Id: Iec879378770017eddd37e9a99346d980355bb6e2 Signed-off-by: xudan --- diff --git a/dovetail/report.py b/dovetail/report.py index 12d6dcad..39326b98 100644 --- a/dovetail/report.py +++ b/dovetail/report.py @@ -274,10 +274,12 @@ class FunctestCrawler(object): if complex_testcase: tests = data['details']['tests'] failed_num = data['details']['failures'] + success_case = data['details']['success'] error_case = data['details']['errors'] skipped_case = data['details']['skipped'] details = {"tests": tests, "failures": failed_num, + "success": success_case, "errors": error_case, "skipped": skipped_case} except KeyError as e: @@ -456,6 +458,13 @@ class FunctestChecker(object): @staticmethod def get_sub_testcase(sub_testcase, result): + # This adaption is because of the danube bug of Functest. + # Has been fixed in Euphrates. + # Patch link https://gerrit.opnfv.org/gerrit/#/c/47897/ + if sub_testcase == "tempest.api.identity.v3.test_tokens." \ + "TokensV3Test.test_create_token": + sub_testcase = "tempest.api.identity.v3.test_t" + if not result: return False sub_testcase = re.sub("\[.*?\]", "", sub_testcase) @@ -487,30 +496,24 @@ class FunctestChecker(object): if sub_testcase_list is None: return - testcase_passed = 'SKIP' + testcase_passed = 'PASS' for sub_testcase in sub_testcase_list: self.logger.debug('Check sub_testcase: {}'.format(sub_testcase)) try: if self.get_sub_testcase(sub_testcase, - db_result['details']['errors']): - testcase.sub_testcase_passed(sub_testcase, 'FAIL') - testcase_passed = 'FAIL' + db_result['details']['success']): + testcase.sub_testcase_passed(sub_testcase, 'PASS') continue if self.get_sub_testcase(sub_testcase, db_result['details']['skipped']): testcase.sub_testcase_passed(sub_testcase, 'SKIP') else: - testcase.sub_testcase_passed(sub_testcase, 'PASS') + testcase.sub_testcase_passed(sub_testcase, 'FAIL') + testcase_passed = 'FAIL' except KeyError: testcase.sub_testcase_passed(sub_testcase, 'FAIL') testcase_passed = 'FAIL' - if testcase_passed == 'SKIP': - for sub_testcase in sub_testcase_list: - if testcase.sub_testcase_status[sub_testcase] == 'PASS': - testcase_passed = 'PASS' - break - testcase.passed(testcase_passed)