diff mbox series

[RFC,4/6] patchtest: allow to not print summary

Message ID 20250203-b4-patchtest-v1-4-ef6ee5fcdd78@cherry.de
State New
Headers show
Series prepare patchtest to be run with b4 prep --check | expand

Commit Message

Quentin Schulz Feb. 3, 2025, 4 p.m. UTC
From: Quentin Schulz <quentin.schulz@cherry.de>

The summary is printed even when quiet is passed if an error happens.
However, in the case when only one patch is passed to patchtest, this
summary isn't useful at all. That is the case for b4 with patchtest used
for b4 prep --check, where patchtest will be executed on each patch
individually so this summary will be redundant.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
 meta/lib/patchtest/patchtest_parser.py | 4 ++++
 scripts/patchtest                      | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/lib/patchtest/patchtest_parser.py b/meta/lib/patchtest/patchtest_parser.py
index 66c54628466b0234f8492f0a7d8ddbe59f5f7582..27ab1d464a58c5747f400921e8388029996d483b 100644
--- a/meta/lib/patchtest/patchtest_parser.py
+++ b/meta/lib/patchtest/patchtest_parser.py
@@ -73,6 +73,10 @@  class PatchtestParser(object):
                             action='store_true',
                             help='Only output error messages')
 
+        parser.add_argument('--no-summary',
+                            action='store_true',
+                            help='Do not output summary of tests')
+
         parser.add_argument('--log-results', 
                             action='store_true', 
                             help='Enable logging to a file matching the target patch name with ".testresult" appended')
diff --git a/scripts/patchtest b/scripts/patchtest
index 6efd69465ef8d8dc6fa459d05220ccd08ca28536..82ce665c1a5c950dfaf02cda9ed70b935a9bfe25 100755
--- a/scripts/patchtest
+++ b/scripts/patchtest
@@ -165,7 +165,9 @@  def run(patch, logfile=None):
     postmerge_resultklass = getResult(patch, True, logfile)
     postmerge_result = _runner(postmerge_resultklass, 'test')
 
-    print_result_message(premerge_result, postmerge_result)
+    if not PatchtestParser.no_summary:
+        print_result_message(premerge_result, postmerge_result)
+
     return premerge_result or postmerge_result
 
 def print_result_message(preresult, postresult):