summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-02-25 14:02:46 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-02-26 11:59:52 +0000
commitc45d58f003e8d8b323169ca9d479dc49c43a9974 (patch)
treee1ea140233e7bfe028775c149676a074059dbe93
parent401d022a26ab66076f0e90bd678e1e810aef36fb (diff)
downloadpoky-c45d58f003e8d8b323169ca9d479dc49c43a9974.tar.gz
resulttool/regression: Improve matching of poor ptest test names4.2_M3
Some test case naming is poor and contains random strings, particularly lttng/babeltrace but also curl. Truncating the test names works since they contain file and line number identifiers which allows us to match them without the random components, or in the case or curl, test IDs. Going forward we may be able to improve the test names but this tweak allows historical test results to work in reports. (From OE-Core rev: 541a2e2683531355e678fd93524a0c4a8c43a8ff) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/resulttool/regression.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/lib/resulttool/regression.py b/scripts/lib/resulttool/regression.py
index 04a2f3fbb0..74fd5f3895 100644
--- a/scripts/lib/resulttool/regression.py
+++ b/scripts/lib/resulttool/regression.py
@@ -248,6 +248,24 @@ def regression_common(args, logger, base_results, target_results):
248 248
249 return 0 249 return 0
250 250
251# Some test case naming is poor and contains random strings, particularly lttng/babeltrace.
252# Truncating the test names works since they contain file and line number identifiers
253# which allows us to match them without the random components.
254def fixup_ptest_names(results, logger):
255 for r in results:
256 for i in results[r]:
257 tests = list(results[r][i]['result'].keys())
258 for test in tests:
259 new = None
260 if test.startswith(("ptestresult.lttng-tools.", "ptestresult.babeltrace.", "ptestresult.babeltrace2")) and "_-_" in test:
261 new = test.split("_-_")[0]
262 elif test.startswith(("ptestresult.curl.")) and "__" in test:
263 new = test.split("__")[0]
264 if new:
265 results[r][i]['result'][new] = results[r][i]['result'][test]
266 del results[r][i]['result'][test]
267
268
251def regression_git(args, logger): 269def regression_git(args, logger):
252 base_results = {} 270 base_results = {}
253 target_results = {} 271 target_results = {}
@@ -309,6 +327,9 @@ def regression_git(args, logger):
309 base_results = resultutils.git_get_result(repo, revs[index1][2]) 327 base_results = resultutils.git_get_result(repo, revs[index1][2])
310 target_results = resultutils.git_get_result(repo, revs[index2][2]) 328 target_results = resultutils.git_get_result(repo, revs[index2][2])
311 329
330 fixup_ptest_names(base_results, logger)
331 fixup_ptest_names(target_results, logger)
332
312 regression_common(args, logger, base_results, target_results) 333 regression_common(args, logger, base_results, target_results)
313 334
314 return 0 335 return 0