summaryrefslogtreecommitdiffstats
path: root/scripts/lib/resulttool/log.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-16 22:51:10 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-16 22:52:15 +0000
commitbedf823032e7b785474c7c8b70c36d63c6d37276 (patch)
tree0c816842500443a719c6381c618e564d27bf5cd2 /scripts/lib/resulttool/log.py
parent6e071e029206d82e90b121c9b110168433574187 (diff)
downloadpoky-bedf823032e7b785474c7c8b70c36d63c6d37276.tar.gz
resulttool: Improve overlapping ptest result reporting
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. (From OE-Core rev: 8391f1668fcbe932ba846299b0ec22de09e06dd4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/resulttool/log.py')
-rw-r--r--scripts/lib/resulttool/log.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/scripts/lib/resulttool/log.py b/scripts/lib/resulttool/log.py
index 621c6c4bac..15148ca288 100644
--- a/scripts/lib/resulttool/log.py
+++ b/scripts/lib/resulttool/log.py
@@ -28,11 +28,6 @@ def show_reproducible(result, reproducible, logger):
28def log(args, logger): 28def log(args, logger):
29 results = resultutils.load_resultsdata(args.source) 29 results = resultutils.load_resultsdata(args.source)
30 30
31 ptest_count = sum(1 for _, _, _, r in resultutils.test_run_results(results) if 'ptestresult.sections' in r)
32 if ptest_count > 1 and not args.prepend_run:
33 print("%i ptest sections found. '--prepend-run' is required" % ptest_count)
34 return 1
35
36 for _, run_name, _, r in resultutils.test_run_results(results): 31 for _, run_name, _, r in resultutils.test_run_results(results):
37 if args.list_ptest: 32 if args.list_ptest:
38 print('\n'.join(sorted(r['ptestresult.sections'].keys()))) 33 print('\n'.join(sorted(r['ptestresult.sections'].keys())))
@@ -51,6 +46,9 @@ def log(args, logger):
51 46
52 os.makedirs(dest_dir, exist_ok=True) 47 os.makedirs(dest_dir, exist_ok=True)
53 dest = os.path.join(dest_dir, '%s.log' % name) 48 dest = os.path.join(dest_dir, '%s.log' % name)
49 if os.path.exists(dest):
50 print("Overlapping ptest logs found, skipping %s. The '--prepend-run' option would avoid this" % name)
51 continue
54 print(dest) 52 print(dest)
55 with open(dest, 'w') as f: 53 with open(dest, 'w') as f:
56 f.write(logdata) 54 f.write(logdata)