From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 2DA63968 for ; Fri, 23 Jun 2017 19:05:52 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP; 23 Jun 2017 10:05:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,379,1493708400"; d="scan'208";a="1186260543" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 23 Jun 2017 10:05:51 -0700 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 23 Jun 2017 10:05:49 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 23 Jun 2017 10:05:48 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.122]) with mapi id 14.03.0319.002; Sat, 24 Jun 2017 01:05:47 +0800 From: "Liu, Yong" To: "Xu, HuilongX" , "dts@dpdk.org" CC: "Xu, HuilongX" Thread-Topic: [dts] [PATCH V1 3/3] update case result write function Thread-Index: AQHS6+VjMoXbNvdmDEeqgtYye/14OKIyrLcA Date: Fri, 23 Jun 2017 17:05:46 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E62E0D423@SHSMSX103.ccr.corp.intel.com> References: <1498197394-16220-1-git-send-email-huilongx.xu@intel.com> <1498197394-16220-3-git-send-email-huilongx.xu@intel.com> In-Reply-To: <1498197394-16220-3-git-send-email-huilongx.xu@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V1 3/3] update case result write function X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jun 2017 17:05:53 -0000 Huilong, some comments below. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,huilong > Sent: Thursday, June 22, 2017 10:57 PM > To: dts@dpdk.org > Cc: Xu, HuilongX > Subject: [dts] [PATCH V1 3/3] update case result write function >=20 > update case result write function, all same case only have one test resul= t > if one time case test result passed, this result will passed and save in > excel file. > if all times case test result failed, this resulr will failed and save in > excel file. >=20 > Signed-off-by: xu,huilong > --- > framework/excel_reporter.py | 25 ++++++++++++++++++++----- > 1 file changed, 20 insertions(+), 5 deletions(-) >=20 > diff --git a/framework/excel_reporter.py b/framework/excel_reporter.py > index 2030d87..aef50c6 100644 > --- a/framework/excel_reporter.py > +++ b/framework/excel_reporter.py > @@ -142,9 +142,23 @@ class ExcelReporter(object): >=20 > self.title_style =3D xlwt.XFStyle() > self.title_style.font =3D title_font > - > - def __write_result(self, dut, target, suite, case): > - test_result =3D self.result.result_for(dut, target, suite, case) > + > + def __get_suite_result(self, dut, target, suite, case): Look like function has been change to get result of certain case. Suggest = to change name of this function to __get_case_result. > + case_list =3D self.result.all_test_cases(dut, target, suite) > + if case_list.count(case) > 1: > + tmp_result =3D [] > + for case_name in case_list: > + if case =3D=3D case_name: > + test_result =3D self.result.result_for(dut, target, > suite, case) > + if 'PASSED' in test_result: > + return ['PASSED', ''] Why return result list with two items here and only return one is other con= dition? =20 > + else: > + tmp_result.append(test_result) > + return tmp_result[-1] > + else: > + return self.result.result_for(dut, target, suite, case) > + > + def __write_result(self, dut, target, suite, case, test_result): > if test_result is not None and len(test_result) > 0: > result =3D test_result[0] > if test_result[1] !=3D '': > @@ -156,13 +170,14 @@ class ExcelReporter(object): > self.row, self.col + 1, result, self.failed_style) >=20 > def __write_cases(self, dut, target, suite): > - for case in self.result.all_test_cases(dut, target, suite): > + for case in set(self.result.all_test_cases(dut, target, suite)): > + result =3D self.__get_suite_result(dut, target, suite, case) > self.col +=3D 1 > if case[:5] =3D=3D "test_": > self.sheet.write(self.row, self.col, case[5:]) > else: > self.sheet.write(self.row, self.col, case) > - self.__write_result(dut, target, suite, case) > + self.__write_result(dut, target, suite, case, result) > self.row +=3D 1 > self.col -=3D 1 >=20 > -- > 1.9.3