From 342d009c706e40cf8899c3e51bc3c344fd033bc6 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Thu, 7 Dec 2023 10:53:48 -0500 Subject: [PATCH 1/2] testlogs plugin: show all tests with "not ok" statuses Instead of hardcoding the default of "FAIL" and "ERROR", let's rely on the canonical source of "not ok" test statuses. This ensures that all tests that need to be looked into are shown at the end of the job on the human UI. Signed-off-by: Cleber Rosa --- avocado/plugins/testlogs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/avocado/plugins/testlogs.py b/avocado/plugins/testlogs.py index 525ddb1635..4b06d45283 100644 --- a/avocado/plugins/testlogs.py +++ b/avocado/plugins/testlogs.py @@ -4,7 +4,7 @@ from avocado.core.output import LOG_JOB, LOG_UI from avocado.core.plugin_interfaces import Init, JobPost, JobPre, ResultEvents from avocado.core.settings import settings -from avocado.core.teststatus import STATUSES +from avocado.core.teststatus import STATUSES, STATUSES_NOT_OK class TestLogsUIInit(Init): @@ -48,7 +48,7 @@ def initialize(self): section="job.output.testlogs", key="summary_statuses", key_type=list, - default=["FAIL", "ERROR"], + default=STATUSES_NOT_OK, help_msg=help_msg, ) From e70856f58c21576b2c4d925943dac126f5e87512 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Thu, 7 Dec 2023 10:58:18 -0500 Subject: [PATCH 2/2] testlogs plugin: show unique test id Instead of showing test names which can indeed repeat within a job. Signed-off-by: Cleber Rosa --- avocado/plugins/testlogs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avocado/plugins/testlogs.py b/avocado/plugins/testlogs.py index 4b06d45283..f2f6af706d 100644 --- a/avocado/plugins/testlogs.py +++ b/avocado/plugins/testlogs.py @@ -79,7 +79,7 @@ def post(self, job): summary_tests = [] for test in results["tests"]: if test["status"] in summary: - line = f"{test['name']}: {test['status']}" + line = f"{test['id']}: {test['status']}" summary_tests.append(line) if not statuses or test["status"] not in statuses: continue