From 2c074ed8e196d4207d07f133db35aeaaba71de1a Mon Sep 17 00:00:00 2001 From: Amador Pahim Date: Thu, 25 Jan 2018 10:54:33 +0100 Subject: [PATCH] html: add warn in success rate Count WARN in to calculate the success rate in the HTML report. Signed-off-by: Amador Pahim --- optional_plugins/html/avocado_result_html/__init__.py | 9 ++++++--- .../resources/templates/report.mustache | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/optional_plugins/html/avocado_result_html/__init__.py b/optional_plugins/html/avocado_result_html/__init__.py index 93c29a36..136b6241 100644 --- a/optional_plugins/html/avocado_result_html/__init__.py +++ b/optional_plugins/html/avocado_result_html/__init__.py @@ -78,11 +78,14 @@ class ReportModel(object): def passed(self): return self.result.passed - def pass_rate(self): + def warned(self): + return self.result.warned + + def rate(self): total = float(self.result.tests_total) - passed = float(self.result.passed) + succeeded = float(self.result.passed + self.result.warned) if total > 0: - pr = 100 * (passed / total) + pr = 100 * (succeeded / total) else: pr = 0 return "%.2f" % pr diff --git a/optional_plugins/html/avocado_result_html/resources/templates/report.mustache b/optional_plugins/html/avocado_result_html/resources/templates/report.mustache index fe6e72f8..aa9aeba8 100644 --- a/optional_plugins/html/avocado_result_html/resources/templates/report.mustache +++ b/optional_plugins/html/avocado_result_html/resources/templates/report.mustache @@ -736,7 +736,7 @@ Cumulative test time{{tests_total_time}} s - StatsFrom {{tests_total}} tests executed, {{passed}} passed (pass rate of {{pass_rate}}%) + StatsFrom {{tests_total}} tests executed, {{passed}} passed and {{warned}} warned (success rate of {{rate}}%) -- GitLab