summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexis Lothoré <alexis.lothore@bootlin.com>2023-10-22 19:49:37 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-23 10:49:17 +0100
commit6de4426d9a7da67deed7d3a3918892fb56238ff3 (patch)
tree7a3b8289a6f4ff481d1d1de06a998f4b998b38fe
parent599267467430e70fa4dc8ba6b2a8b126bf6da359 (diff)
downloadopenembedded-core-contrib-6de4426d9a7da67deed7d3a3918892fb56238ff3.tar.gz
scripts/resulttool: make additional info more compact
Since "matched" and "improved" tests are not as important as regressions, reduce the place they take in the regression report: - merge "matched" and "improved" tests, while removing the label - add a single line of additional info per pair Those changes make the "Matches and improvements" look like the following sample: oeselftest_almalinux-9.2_qemux86-64_20230910083156 oeselftest_almalinux-8.8_qemux86-64_20231018010951 -> +7 test(s) present oeselftest_almalinux-9.2_qemux86-64_20230911010538 oeselftest_debian-11_qemux86-64_20231017150459 oeselftest_debian-11_qemux86-64_20230910012927 oeselftest_debian-11_qemux86-64_20231017151319 -> +7 test(s) present [...] Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r--scripts/lib/resulttool/regression.py27
1 files changed, 23 insertions, 4 deletions
diff --git a/scripts/lib/resulttool/regression.py b/scripts/lib/resulttool/regression.py
index 560d102e17..8fbe5a5478 100644
--- a/scripts/lib/resulttool/regression.py
+++ b/scripts/lib/resulttool/regression.py
@@ -186,6 +186,18 @@ def get_status_str(raw_status):
raw_status_lower = raw_status.lower() if raw_status else "None"
return STATUS_STRINGS.get(raw_status_lower, raw_status)
+def get_additional_info_line(new_pass_count, new_tests):
+ result=[]
+ if new_tests:
+ result.append(f'+{new_tests} test(s) present')
+ if new_pass_count:
+ result.append(f'+{new_pass_count} test(s) now passing')
+
+ if not result:
+ return ""
+
+ return ' -> ' + ', '.join(result) + '\n'
+
def compare_result(logger, base_name, target_name, base_result, target_result, display_limit=None):
base_result = base_result.get('result')
target_result = target_result.get('result')
@@ -193,6 +205,8 @@ def compare_result(logger, base_name, target_name, base_result, target_result, d
new_tests = 0
regressions = {}
resultstring = ""
+ new_tests = 0
+ new_pass_count = 0
display_limit = int(display_limit) if display_limit else REGRESSIONS_DISPLAY_LIMIT
@@ -234,14 +248,19 @@ def compare_result(logger, base_name, target_name, base_result, target_result, d
resultstring+=' [...]\n'
if new_pass_count > 0:
resultstring += f' Additionally, {new_pass_count} previously failing test(s) is/are now passing\n'
+ if new_tests > 0:
+ resultstring += f' Additionally, {new_tests} new test(s) is/are present\n'
else:
- resultstring = "Improvement: %s\n %s\n (+%d test(s) passing)\n" % (base_name, target_name, new_pass_count)
+ resultstring = "%s\n%s\n" % (base_name, target_name)
result = None
else:
- resultstring = "Match: %s\n %s\n" % (base_name, target_name)
+ resultstring = "%s\n%s\n" % (base_name, target_name)
+
+ if not result:
+ additional_info = get_additional_info_line(new_pass_count, new_tests)
+ if additional_info:
+ resultstring += additional_info
- if new_tests > 0:
- resultstring += f' Additionally, {new_tests} new test(s) is/are present\n'
return result, resultstring
def get_results(logger, source):