diff mbox series

resulttool: Improve overlapping ptest result reporting

Message ID 20230316225206.247906-1-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit 8391f1668fcbe932ba846299b0ec22de09e06dd4
Headers show
Series resulttool: Improve overlapping ptest result reporting | expand

Commit Message

Richard Purdie March 16, 2023, 10:52 p.m. UTC
With the move to a ptest per image, the multiple ptest log scenario
is much more likely. Tweak the handling to only warn if there are
overlapping files.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 scripts/lib/resulttool/log.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/scripts/lib/resulttool/log.py b/scripts/lib/resulttool/log.py
index 621c6c4bacc..15148ca2881 100644
--- a/scripts/lib/resulttool/log.py
+++ b/scripts/lib/resulttool/log.py
@@ -28,11 +28,6 @@  def show_reproducible(result, reproducible, logger):
 def log(args, logger):
     results = resultutils.load_resultsdata(args.source)
 
-    ptest_count = sum(1 for _, _, _, r in resultutils.test_run_results(results) if 'ptestresult.sections' in r)
-    if ptest_count > 1 and not args.prepend_run:
-        print("%i ptest sections found. '--prepend-run' is required" % ptest_count)
-        return 1
-
     for _, run_name, _, r in resultutils.test_run_results(results):
         if args.list_ptest:
             print('\n'.join(sorted(r['ptestresult.sections'].keys())))
@@ -51,6 +46,9 @@  def log(args, logger):
 
                     os.makedirs(dest_dir, exist_ok=True)
                     dest = os.path.join(dest_dir, '%s.log' % name)
+                    if os.path.exists(dest):
+                        print("Overlapping ptest logs found, skipping %s. The '--prepend-run' option would avoid this" % name)
+                        continue
                     print(dest)
                     with open(dest, 'w') as f:
                         f.write(logdata)