[Fuego] [PATCH 3/3] ftc: gen-report: Add support csv formatter

Tim.Bird at sony.com Tim.Bird at sony.com
Thu Mar 8 18:41:49 UTC 2018


Applied.  Thanks.
 -- Tim

> -----Original Message-----
> From: fuego-bounces at lists.linuxfoundation.org [mailto:fuego-
> bounces at lists.linuxfoundation.org] On Behalf Of Hoang Van Tuyen
> Sent: Wednesday, March 07, 2018 6:51 PM
> To: Bird, Timothy <Tim.Bird at sony.com>; fuego at lists.linuxfoundation.org
> Subject: Re: [Fuego] [PATCH 3/3] ftc: gen-report: Add support csv formatter
> 
> I re-send the patch in an attachment.
> 
> 
> On 3/8/2018 6:10 AM, Tim.Bird at sony.com wrote:
> > Please resubmit this whole series.
> >   -- Tim
> >
> >> -----Original Message-----
> >> From: fuego-bounces at lists.linuxfoundation.org [mailto:fuego-
> >> bounces at lists.linuxfoundation.org] On Behalf Of Hoang Van Tuyen
> >> Sent: Thursday, March 01, 2018 7:37 PM
> >> To: fuego at lists.linuxfoundation.org
> >> Subject: [Fuego] [PATCH 3/3] ftc: gen-report: Add support csv formatter
> >>
> >> Add a formatter for csv format. The report file is stored in ${report_dir}
> >> In future, we will add support viewing the report in the Jenkins interface
> >>
> >> Signed-off-by: Hoang Van Tuyen <tuyen.hoangvan at toshiba-tsdv.com>
> >> ---
> >>    engine/scripts/ftc | 17 ++++++++++++++++-
> >>    1 file changed, 16 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/engine/scripts/ftc b/engine/scripts/ftc
> >> index e0ed13d..386e9ca 100755
> >> --- a/engine/scripts/ftc
> >> +++ b/engine/scripts/ftc
> >> @@ -2140,6 +2140,18 @@ def gen_excel_report(header_data,
> report_data,
> >> report_dir):
> >>        # save the report
> >>        workbook.save(report_dir + "report.xlsx")
> >>
> >> +def gen_csv_report(header_data, report_data, report_dir):
> >> +    import csv
> >> +
> >> +    filename = report_dir + "report.csv"
> >> +    # generate header
> >> +    with open(filename, "wb") as report:
> >> +        writer = csv.writer(report)
> >> +        writer.writerows(header_data)
> >> +
> >> +    # generate lines for this report
> >> +        writer.writerows(report_data)
> >> +
> >>    # generate a report from run results
> >>    def do_gen_report(conf, options):
> >>        global quiet, verbose
> >> @@ -2161,7 +2173,7 @@ def do_gen_report(conf, options):
> >>        fmt="txt"
> >>        if "--format" in options:
> >>            fmt = options[options.index("--format")+1]
> >> -        if fmt not in ["txt","html","pdf","excel"]:
> >> +        if fmt not in ["txt","html","pdf","excel","csv"]:
> >>                error_out("Unsupported format '%s' specified" % fmt)
> >>
> >>        if "--layout" in options:
> >> @@ -2195,6 +2207,9 @@ def do_gen_report(conf, options):
> >>        if fmt=="excel":
> >>            gen_excel_report(header_data, report_data, report_dir)
> >>            sys.exit(0)
> >> +    if fmt=="csv":
> >> +        gen_csv_report(header_data, report_data, report_dir)
> >> +        sys.exit(0)
> >>
> >>        print report
> >>
> >> --
> >> 2.1.4
> >>
> >>
> >>
> >> --
> >> This mail was scanned by BitDefender
> >> For more information please visit http://www.bitdefender.com
> >>
> >> _______________________________________________
> >> Fuego mailing list
> >> Fuego at lists.linuxfoundation.org
> >> https://lists.linuxfoundation.org/mailman/listinfo/fuego
> 
> _______________________________________________
> Fuego mailing list
> Fuego at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego



More information about the Fuego mailing list