summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorAlexis Lothoré <alexis.lothore@bootlin.com>2023-08-02 16:17:17 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-08-04 11:44:28 +0100
commit6de3817c62d896545fc460b1b265a0f6b35dbd3e (patch)
tree0a63231e27f2a70e62b3e6e57b6e4b8eade63eb5 /scripts/lib
parent024bea32984174885a1767b063816077781fbc6b (diff)
downloadpoky-6de3817c62d896545fc460b1b265a0f6b35dbd3e.tar.gz
scripts/resulttool: allow to replace test raw status with custom string
Add a STATUS_STRINGS dictionnary matching raw statuses to custom strings. Whenever a regression must be reported, raw status is searched in the custom statuses dict (key search is case insensitive). If no custom string is found, raw status is kept and used in regression report (From OE-Core rev: 9d22bfc9d0c4092dba1af0ee11a4c51b7b270786) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/resulttool/regression.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/lib/resulttool/regression.py b/scripts/lib/resulttool/regression.py
index f80a9182a9..3a23d7fc0a 100644
--- a/scripts/lib/resulttool/regression.py
+++ b/scripts/lib/resulttool/regression.py
@@ -74,6 +74,9 @@ OESELFTEST_METADATA_GUESS_TABLE={
74 } 74 }
75} 75}
76 76
77STATUS_STRINGS = {
78}
79
77def test_has_at_least_one_matching_tag(test, tag_list): 80def test_has_at_least_one_matching_tag(test, tag_list):
78 return "oetags" in test and any(oetag in tag_list for oetag in test["oetags"]) 81 return "oetags" in test and any(oetag in tag_list for oetag in test["oetags"])
79 82
@@ -173,6 +176,9 @@ def can_be_compared(logger, base, target):
173 return ret and metadata_matches(base_configuration, target_configuration) \ 176 return ret and metadata_matches(base_configuration, target_configuration) \
174 and machine_matches(base_configuration, target_configuration) 177 and machine_matches(base_configuration, target_configuration)
175 178
179def get_status_str(raw_status):
180 raw_status_lower = raw_status.lower() if raw_status else "None"
181 return STATUS_STRINGS.get(raw_status_lower, raw_status)
176 182
177def compare_result(logger, base_name, target_name, base_result, target_result): 183def compare_result(logger, base_name, target_name, base_result, target_result):
178 base_result = base_result.get('result') 184 base_result = base_result.get('result')
@@ -205,7 +211,7 @@ def compare_result(logger, base_name, target_name, base_result, target_result):
205 resultstring = "Regression: %s\n %s\n" % (base_name, target_name) 211 resultstring = "Regression: %s\n %s\n" % (base_name, target_name)
206 for k in sorted(result): 212 for k in sorted(result):
207 if not result[k]['target'] or not result[k]['target'].startswith("PASS"): 213 if not result[k]['target'] or not result[k]['target'].startswith("PASS"):
208 resultstring += ' %s: %s -> %s\n' % (k, result[k]['base'], result[k]['target']) 214 resultstring += ' %s: %s -> %s\n' % (k, get_status_str(result[k]['base']), get_status_str(result[k]['target']))
209 if new_pass_count > 0: 215 if new_pass_count > 0:
210 resultstring += f' Additionally, {new_pass_count} previously failing test(s) is/are now passing\n' 216 resultstring += f' Additionally, {new_pass_count} previously failing test(s) is/are now passing\n'
211 else: 217 else: