]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/resulttool/report: Add total statistic to test result.
authorYeoh Ee Peng <ee.peng.yeoh@intel.com>
Thu, 7 Nov 2019 09:50:29 +0000 (17:50 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 14 Nov 2019 12:55:56 +0000 (12:55 +0000)
Add total passed, failed, and skipped statistic to test result.

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/resulttool/report.py
scripts/lib/resulttool/template/test_report_full_text.txt

index 0c83fb6a74fb1e9fd425d468ba66c8f376608a75..692dd7a851b9cd1b38b942974251f9ffd22b5e34 100644 (file)
@@ -186,6 +186,10 @@ class ResultsTextReport(object):
                 havefailed = True
             if line['machine'] not in machines:
                 machines.append(line['machine'])
+        reporttotalvalues = {}
+        for k in cols:
+            reporttotalvalues[k] = '%s' % sum([line[k] for line in test_count_reports])
+        reporttotalvalues['count'] = '%s' % len(test_count_reports)
         for (machine, report) in self.ptests.items():
             for ptest in self.ptests[machine]:
                 if len(ptest) > maxlen['ptest']:
@@ -199,6 +203,7 @@ class ResultsTextReport(object):
                 if len(ltpposixtest) > maxlen['ltpposixtest']:
                     maxlen['ltpposixtest'] = len(ltpposixtest)
         output = template.render(reportvalues=reportvalues,
+                                 reporttotalvalues=reporttotalvalues,
                                  havefailed=havefailed,
                                  machines=machines,
                                  ptests=self.ptests,
index 17c99cb4e7388028401d19b8b96fc64fe8715bf9..2efba2ef6f2f58421f23d611f2d48e4398fa2dd3 100644 (file)
@@ -8,7 +8,8 @@ Test Result Status Summary (Counts/Percentages sorted by testseries, ID)
 {{ report.testseries.ljust(maxlen['testseries']) }} | {{ report.result_id.ljust(maxlen['result_id']) }} | {{ (report.passed|string).ljust(maxlen['passed']) }} | {{ (report.failed|string).ljust(maxlen['failed']) }} | {{ (report.skipped|string).ljust(maxlen['skipped']) }}
 {% endfor %}
 --------------------------------------------------------------------------------------------------------------
-
+{{ 'Total'.ljust(maxlen['testseries']) }} | {{ reporttotalvalues['count'].ljust(maxlen['result_id']) }} | {{ reporttotalvalues['passed'].ljust(maxlen['passed']) }} | {{ reporttotalvalues['failed'].ljust(maxlen['failed']) }} | {{ reporttotalvalues['skipped'].ljust(maxlen['skipped']) }}
+--------------------------------------------------------------------------------------------------------------
 
 {% for machine in machines %}
 {% if ptests[machine] %}