* [Fuego] [PATCH 3/3] ftc: gen-report: Add support csv formatter
@ 2018-03-02 3:36 Hoang Van Tuyen
2018-03-07 23:10 ` Tim.Bird
0 siblings, 1 reply; 6+ messages in thread
From: Hoang Van Tuyen @ 2018-03-02 3:36 UTC (permalink / raw)
To: fuego
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@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
--
================================================================
Hoang Van Tuyen (Mr.)
TOSHIBA SOFTWARE DEVELOPMENT (VIETNAM) CO., LTD.
16th Floor, VIT Building, 519 Kim Ma Str., Ba Dinh Dist., Hanoi, Vietnam
Tel: 84-4-22208801 (Company) - Ext.251
Fax: 84-4-22208802 (Company)
Email: tuyen.hoangvan@toshiba-tsdv.com
================================================================
--
This mail was scanned by BitDefender
For more information please visit http://www.bitdefender.com
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Fuego] [PATCH 3/3] ftc: gen-report: Add support csv formatter
2018-03-02 3:36 [Fuego] [PATCH 3/3] ftc: gen-report: Add support csv formatter Hoang Van Tuyen
@ 2018-03-07 23:10 ` Tim.Bird
2018-03-08 2:50 ` Hoang Van Tuyen
0 siblings, 1 reply; 6+ messages in thread
From: Tim.Bird @ 2018-03-07 23:10 UTC (permalink / raw)
To: tuyen.hoangvan, fuego
Please resubmit this whole series.
-- Tim
> -----Original Message-----
> From: fuego-bounces@lists.linuxfoundation.org [mailto:fuego-
> bounces@lists.linuxfoundation.org] On Behalf Of Hoang Van Tuyen
> Sent: Thursday, March 01, 2018 7:37 PM
> To: fuego@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@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
>
>
> --
> ==========================================================
> ======
> Hoang Van Tuyen (Mr.)
> TOSHIBA SOFTWARE DEVELOPMENT (VIETNAM) CO., LTD.
> 16th Floor, VIT Building, 519 Kim Ma Str., Ba Dinh Dist., Hanoi, Vietnam
> Tel: 84-4-22208801 (Company) - Ext.251
> Fax: 84-4-22208802 (Company)
> Email: tuyen.hoangvan@toshiba-tsdv.com
> ==========================================================
> ======
>
>
> --
> This mail was scanned by BitDefender
> For more information please visit http://www.bitdefender.com
>
> _______________________________________________
> Fuego mailing list
> Fuego@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Fuego] [PATCH 3/3] ftc: gen-report: Add support csv formatter
2018-03-07 23:10 ` Tim.Bird
@ 2018-03-08 2:50 ` Hoang Van Tuyen
2018-03-08 18:41 ` Tim.Bird
2018-03-08 19:14 ` Tim.Bird
0 siblings, 2 replies; 6+ messages in thread
From: Hoang Van Tuyen @ 2018-03-08 2:50 UTC (permalink / raw)
To: Tim.Bird, fuego
[-- Attachment #1: Type: text/plain, Size: 2789 bytes --]
I re-send the patch in an attachment.
On 3/8/2018 6:10 AM, Tim.Bird@sony.com wrote:
> Please resubmit this whole series.
> -- Tim
>
>> -----Original Message-----
>> From: fuego-bounces@lists.linuxfoundation.org [mailto:fuego-
>> bounces@lists.linuxfoundation.org] On Behalf Of Hoang Van Tuyen
>> Sent: Thursday, March 01, 2018 7:37 PM
>> To: fuego@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@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@lists.linuxfoundation.org
>> https://lists.linuxfoundation.org/mailman/listinfo/fuego
_______________________________________________
Fuego mailing list
Fuego@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/fuego
[-- Attachment #2: 0003-ftc-gen-report-Add-support-csv-formatter.patch --]
[-- Type: text/plain, Size: 1935 bytes --]
From f65045178c538e4178af4e9dd3496d0c7498179a Mon Sep 17 00:00:00 2001
From: Hoang Van Tuyen <tuyen.hoangvan@toshiba-tsdv.com>
Date: Fri, 2 Mar 2018 10:01:50 +0700
Subject: [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@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
[-- Attachment #3: Bitdefender.txt --]
[-- Type: text/plain, Size: 102 bytes --]
--
This mail was scanned by BitDefender
For more information please visit http://www.bitdefender.com
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Fuego] [PATCH 3/3] ftc: gen-report: Add support csv formatter
2018-03-08 2:50 ` Hoang Van Tuyen
@ 2018-03-08 18:41 ` Tim.Bird
2018-03-08 19:14 ` Tim.Bird
1 sibling, 0 replies; 6+ messages in thread
From: Tim.Bird @ 2018-03-08 18:41 UTC (permalink / raw)
To: tuyen.hoangvan, fuego
Applied. Thanks.
-- Tim
> -----Original Message-----
> From: fuego-bounces@lists.linuxfoundation.org [mailto:fuego-
> bounces@lists.linuxfoundation.org] On Behalf Of Hoang Van Tuyen
> Sent: Wednesday, March 07, 2018 6:51 PM
> To: Bird, Timothy <Tim.Bird@sony.com>; fuego@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@sony.com wrote:
> > Please resubmit this whole series.
> > -- Tim
> >
> >> -----Original Message-----
> >> From: fuego-bounces@lists.linuxfoundation.org [mailto:fuego-
> >> bounces@lists.linuxfoundation.org] On Behalf Of Hoang Van Tuyen
> >> Sent: Thursday, March 01, 2018 7:37 PM
> >> To: fuego@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@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@lists.linuxfoundation.org
> >> https://lists.linuxfoundation.org/mailman/listinfo/fuego
>
> _______________________________________________
> Fuego mailing list
> Fuego@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Fuego] [PATCH 3/3] ftc: gen-report: Add support csv formatter
2018-03-08 2:50 ` Hoang Van Tuyen
2018-03-08 18:41 ` Tim.Bird
@ 2018-03-08 19:14 ` Tim.Bird
2018-03-09 0:38 ` Hoang Van Tuyen
1 sibling, 1 reply; 6+ messages in thread
From: Tim.Bird @ 2018-03-08 19:14 UTC (permalink / raw)
To: tuyen.hoangvan, fuego
Hoang,
Since you are now familiar with the ftc gen-report functions,
can I ask you to consider making a function to output a
report in 'rst', or reStructuredText, format?
You should be able to base it off of gen_txt_report.
Please let me know if you could work on that.
Thanks,
-- Tim
> -----Original Message-----
> From: Hoang Van Tuyen
> >> -----Original Message-----
> >> From: fuego-bounces@lists.linuxfoundation.org [mailto:fuego-
> >> bounces@lists.linuxfoundation.org] On Behalf Of Hoang Van Tuyen
> >> Sent: Thursday, March 01, 2018 7:37 PM
> >> To: fuego@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@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@lists.linuxfoundation.org
> >> https://lists.linuxfoundation.org/mailman/listinfo/fuego
>
> _______________________________________________
> Fuego mailing list
> Fuego@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Fuego] [PATCH 3/3] ftc: gen-report: Add support csv formatter
2018-03-08 19:14 ` Tim.Bird
@ 2018-03-09 0:38 ` Hoang Van Tuyen
0 siblings, 0 replies; 6+ messages in thread
From: Hoang Van Tuyen @ 2018-03-09 0:38 UTC (permalink / raw)
To: Tim.Bird, fuego
[-- Attachment #1.1: Type: text/plain, Size: 620 bytes --]
Hello Tim,
On 3/9/2018 2:14 AM, Tim.Bird@sony.com wrote:
> Hoang,
>
> Since you are now familiar with the ftc gen-report functions,
> can I ask you to consider making a function to output a
> report in 'rst', or reStructuredText, format?
Yes. I can do that.
>
> You should be able to base it off of gen_txt_report.
> Please let me know if you could work on that.
Thanks for your guide. I will follow the suggestion.
>
> Thanks,
> -- Tim
Best regards,
Tuyen
_______________________________________________
Fuego mailing list
Fuego@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/fuego
[-- Attachment #1.2: Type: text/html, Size: 1645 bytes --]
[-- Attachment #2: Bitdefender.txt --]
[-- Type: text/plain, Size: 102 bytes --]
--
This mail was scanned by BitDefender
For more information please visit http://www.bitdefender.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-03-09 0:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-02 3:36 [Fuego] [PATCH 3/3] ftc: gen-report: Add support csv formatter Hoang Van Tuyen
2018-03-07 23:10 ` Tim.Bird
2018-03-08 2:50 ` Hoang Van Tuyen
2018-03-08 18:41 ` Tim.Bird
2018-03-08 19:14 ` Tim.Bird
2018-03-09 0:38 ` Hoang Van Tuyen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.