diff options
| author | Alexis Lothoré <alexis.lothore@bootlin.com> | 2023-10-22 19:49:37 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-10-23 10:49:19 +0100 |
| commit | 198110b1b954ae6fbd6b2d648c3a5bcc71c412a5 (patch) | |
| tree | 9232d853e073589e63c7faf9a3f0055474eb9437 /scripts/lib | |
| parent | faef63eab69829eea7227ca3825c1c533c648b24 (diff) | |
| download | poky-198110b1b954ae6fbd6b2d648c3a5bcc71c412a5.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
[...]
(From OE-Core rev: 6de4426d9a7da67deed7d3a3918892fb56238ff3)
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.py | 27 |
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): | |||
| 186 | raw_status_lower = raw_status.lower() if raw_status else "None" | 186 | raw_status_lower = raw_status.lower() if raw_status else "None" |
| 187 | return STATUS_STRINGS.get(raw_status_lower, raw_status) | 187 | return STATUS_STRINGS.get(raw_status_lower, raw_status) |
| 188 | 188 | ||
| 189 | def get_additional_info_line(new_pass_count, new_tests): | ||
| 190 | result=[] | ||
| 191 | if new_tests: | ||
| 192 | result.append(f'+{new_tests} test(s) present') | ||
| 193 | if new_pass_count: | ||
| 194 | result.append(f'+{new_pass_count} test(s) now passing') | ||
| 195 | |||
| 196 | if not result: | ||
| 197 | return "" | ||
| 198 | |||
| 199 | return ' -> ' + ', '.join(result) + '\n' | ||
| 200 | |||
| 189 | def compare_result(logger, base_name, target_name, base_result, target_result, display_limit=None): | 201 | def compare_result(logger, base_name, target_name, base_result, target_result, display_limit=None): |
| 190 | base_result = base_result.get('result') | 202 | base_result = base_result.get('result') |
| 191 | target_result = target_result.get('result') | 203 | target_result = target_result.get('result') |
| @@ -193,6 +205,8 @@ def compare_result(logger, base_name, target_name, base_result, target_result, d | |||
| 193 | new_tests = 0 | 205 | new_tests = 0 |
| 194 | regressions = {} | 206 | regressions = {} |
| 195 | resultstring = "" | 207 | resultstring = "" |
| 208 | new_tests = 0 | ||
| 209 | new_pass_count = 0 | ||
| 196 | 210 | ||
| 197 | display_limit = int(display_limit) if display_limit else REGRESSIONS_DISPLAY_LIMIT | 211 | display_limit = int(display_limit) if display_limit else REGRESSIONS_DISPLAY_LIMIT |
| 198 | 212 | ||
| @@ -234,14 +248,19 @@ def compare_result(logger, base_name, target_name, base_result, target_result, d | |||
| 234 | resultstring+=' [...]\n' | 248 | resultstring+=' [...]\n' |
| 235 | if new_pass_count > 0: | 249 | if new_pass_count > 0: |
| 236 | resultstring += f' Additionally, {new_pass_count} previously failing test(s) is/are now passing\n' | 250 | resultstring += f' Additionally, {new_pass_count} previously failing test(s) is/are now passing\n' |
| 251 | if new_tests > 0: | ||
| 252 | resultstring += f' Additionally, {new_tests} new test(s) is/are present\n' | ||
| 237 | else: | 253 | else: |
| 238 | resultstring = "Improvement: %s\n %s\n (+%d test(s) passing)\n" % (base_name, target_name, new_pass_count) | 254 | resultstring = "%s\n%s\n" % (base_name, target_name) |
| 239 | result = None | 255 | result = None |
| 240 | else: | 256 | else: |
| 241 | resultstring = "Match: %s\n %s\n" % (base_name, target_name) | 257 | resultstring = "%s\n%s\n" % (base_name, target_name) |
| 258 | |||
| 259 | if not result: | ||
| 260 | additional_info = get_additional_info_line(new_pass_count, new_tests) | ||
| 261 | if additional_info: | ||
| 262 | resultstring += additional_info | ||
| 242 | 263 | ||
| 243 | if new_tests > 0: | ||
| 244 | resultstring += f' Additionally, {new_tests} new test(s) is/are present\n' | ||
| 245 | return result, resultstring | 264 | return result, resultstring |
| 246 | 265 | ||
| 247 | def get_results(logger, source): | 266 | def get_results(logger, source): |
