From: "Xu, HuilongX" <huilongx.xu@intel.com>
To: "Liu, Yong" <yong.liu@intel.com>, "dts@dpdk.org" <dts@dpdk.org>
Subject: Re: [dts] [PATCH V1 3/3] update case result write function
Date: Wed, 28 Jun 2017 05:41:56 +0000 [thread overview]
Message-ID: <DF2A19295B96364286FEB7F3DDA27A4668DAC1C3@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <86228AFD5BCD8E4EBFD2B90117B5E81E62E0D423@SHSMSX103.ccr.corp.intel.com>
> -----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
>
> 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 <huilongx.xu@intel.com>
> > 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 <huilongx.xu@intel.com>
> > ---
> > 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 = xlwt.XFStyle()
> > self.title_style.font = title_font
> > -
> > - def __write_result(self, dut, target, suite, case):
> > - test_result = 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.
Shure, I will update it in next version
>
> > + case_list = self.result.all_test_cases(dut, target, suite)
> > + if case_list.count(case) > 1:
> > + tmp_result = []
> > + for case_name in case_list:
> > + if case == case_name:
> > + test_result = 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
> condition?
Yes, because when write test result to excel file, the result must is a list. And result[0] is result, and result[1] is error info.
>
> > + 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 = test_result[0]
> > if test_result[1] != '':
> > @@ -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 = self.__get_suite_result(dut, target, suite,
> > + case)
> > self.col += 1
> > if case[:5] == "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 += 1
> > self.col -= 1
> >
> > --
> > 1.9.3
next prev parent reply other threads:[~2017-06-28 5:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-23 5:56 [dts] [PATCH V1 1/3] add re_run parameter xu,huilong
2017-06-23 5:56 ` [dts] [PATCH V1 2/3] update exec case function xu,huilong
2017-06-23 5:56 ` [dts] [PATCH V1 3/3] update case result write function xu,huilong
2017-06-23 17:05 ` Liu, Yong
2017-06-28 5:41 ` Xu, HuilongX [this message]
2017-06-23 16:42 ` [dts] [PATCH V1 1/3] add re_run parameter Liu, Yong
2017-06-28 5:38 ` Xu, HuilongX
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DF2A19295B96364286FEB7F3DDA27A4668DAC1C3@SHSMSX101.ccr.corp.intel.com \
--to=huilongx.xu@intel.com \
--cc=dts@dpdk.org \
--cc=yong.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).