From a63423be30bd1f5677da3d6c0db82647fd0d9a1c Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Fri, 10 Nov 2023 14:58:34 +0100 Subject: [PATCH] optional_plugins/html: color test results Similar to console output, color the result of a test accordingly. PASSed tests are green. WARN + SKIP + CANCEL + are dark-yellowish. FAIL + ERROR + INTERRUPTED are RED. Add "not passed" tests to summary while here. Signed-off-by: Wolfram Sang --- .../avocado_result_html/templates/results.html | 17 ++++++++++++++--- .../avocado_result_html/templates/style.css | 12 ++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/optional_plugins/html/avocado_result_html/templates/results.html b/optional_plugins/html/avocado_result_html/templates/results.html index 8110d339ee..808a2dc7ec 100644 --- a/optional_plugins/html/avocado_result_html/templates/results.html +++ b/optional_plugins/html/avocado_result_html/templates/results.html @@ -50,8 +50,9 @@

Summary

Stats From {{ data.result.tests_total }} tests executed, - {{ data.result.passed }} passed and - {{ data.result.warned }} warned - success rate of + {{ data.result.passed }} passed, + {{ data.result.failed + data.result.errors + data.result.interrupted }} did not pass, and + {{ data.result.warned }} warned - success rate of {{ '%.2f'|format(data.result.rate) }}% (excluding SKIP and CANCEL) @@ -106,7 +107,17 @@

Summary

{{ test.variant }}
-
{{ test.status }}
+ + {% if test.status == 'PASS' %} +
+ {% elif test.status == 'WARN' or test.status == 'SKIP' or test.status == 'CANCEL' %} +
+ {% else %} +
+ {% endif %} + {{ test.status }} +
+
{{ test.time }}