From 38fb18c67b4ade170243be470e0f20677fcfecef Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Mon, 23 Feb 2026 13:06:48 -0500 Subject: [PATCH] Low: cts: Consolidate tests in cts-lab result output It's possible to run the same test multiple times, like so: --choose "ComponentFail ComponentFail" If you do, the test summary will list each one individually: Jan 31 09:28:13 Test ComponentFail {'calls': 1, 'failure': 0, 'skipped': 0, 'auditfail': 0} Jan 31 09:28:13 Test ComponentFail {'calls': 1, 'failure': 0, 'skipped': 0, 'auditfail': 0} Instead, these can be condensed into a single row: Feb 23 13:42:38 rhel9-ctslab-exec Test ComponentFail {'calls': 2, 'failure': 0, 'skipped': 0, 'auditfail': 0} Note that I've chosen to leave the detailed results as they are. This is because the details results may contain other information that differs from run to run, even of the same test, and we may want to see that. Fixes T1018 --- python/pacemaker/_cts/scenarios.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/python/pacemaker/_cts/scenarios.py b/python/pacemaker/_cts/scenarios.py index 6b055f9fe2c..2d97bac177d 100644 --- a/python/pacemaker/_cts/scenarios.py +++ b/python/pacemaker/_cts/scenarios.py @@ -8,7 +8,7 @@ "RandomTests", "Sequence", ] -__copyright__ = "Copyright 2000-2025 the Pacemaker project contributors" +__copyright__ = "Copyright 2000-2026 the Pacemaker project contributors" __license__ = "GNU General Public License version 2 or later (GPLv2+) WITHOUT ANY WARRANTY" import re @@ -251,19 +251,19 @@ def summarize(self): self._cm.log("Overall Results:%r" % self.stats) self._cm.log("****************") - stat_filter = { - "calls": 0, - "failure": 0, - "skipped": 0, - "auditfail": 0, - } + stat_summary = {} + summary_keys = ["calls", "failure", "skipped", "auditfail"] self._cm.log("Test Summary") for test in self.tests: - for key in stat_filter: - stat_filter[key] = test.stats[key] + if test.name not in stat_summary: + stat_summary[test.name] = {key: 0 for key in summary_keys} + + for key in summary_keys: + stat_summary[test.name][key] += test.stats[key] - self._cm.log(f"{f'Test {test.name}':<25} {stat_filter!r}") + for (name, summary) in stat_summary.items(): + self._cm.log(f"{f'Test {name}':<25} {summary!r}") self._cm.debug("Detailed Results") for test in self.tests: