From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id B95AC2904 for ; Wed, 28 Jun 2017 07:42:02 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jun 2017 22:42:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,274,1496127600"; d="scan'208";a="1187796491" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga002.fm.intel.com with ESMTP; 27 Jun 2017 22:42:01 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 27 Jun 2017 22:42:01 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 27 Jun 2017 22:42:00 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.197]) by shsmsx102.ccr.corp.intel.com ([169.254.2.146]) with mapi id 14.03.0319.002; Wed, 28 Jun 2017 13:41:57 +0800 From: "Xu, HuilongX" To: "Liu, Yong" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH V1 3/3] update case result write function Thread-Index: AQHS6+VTLCst1jtcTkCQrTCscc7v4aIyKAEAgAeiAMA= Date: Wed, 28 Jun 2017 05:41:56 +0000 Message-ID: References: <1498197394-16220-1-git-send-email-huilongx.xu@intel.com> <1498197394-16220-3-git-send-email-huilongx.xu@intel.com> <86228AFD5BCD8E4EBFD2B90117B5E81E62E0D423@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <86228AFD5BCD8E4EBFD2B90117B5E81E62E0D423@SHSMSX103.ccr.corp.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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: Wed, 28 Jun 2017 05:42:03 -0000 > -----Original Message----- > From: Liu, Yong > Sent: Saturday, June 24, 2017 1:06 AM > To: Xu, HuilongX; dts@dpdk.org > Cc: Xu, HuilongX > Subject: RE: [dts] [PATCH V1 3/3] update case result write function >=20 > Huilong, some comments below. >=20 > > -----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 > > > > update case result write function, all same case only have one test > > result 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. > > > > Signed-off-by: xu,huilong > > --- > > framework/excel_reporter.py | 25 ++++++++++++++++++++----- > > 1 file changed, 20 insertions(+), 5 deletions(-) > > > > 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): > > > > 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, cas= e) > > + > > + def __get_suite_result(self, dut, target, suite, case): >=20 >=20 > Look like function has been change to get result of certain case. Sugges= t to > change name of this function to __get_case_result. Shure, I will update it in next version >=20 > > + 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', ''] >=20 > Why return result list with two items here and only return one is other > condition? Yes, because when write test result to excel file, the result must is a lis= t. And result[0] is result, and result[1] is error info. >=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) > > > > 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 > > > > -- > > 1.9.3