summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAlexis Lothoré <alexis.lothore@bootlin.com>2023-02-28 19:10:45 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-12 23:39:12 +0000
commite8048a5b66d9833a9d41df3a160dd48e3de104b0 (patch)
tree2554238e9cc038770a591d2afddc4e8f427cb1e6 /scripts
parentf29a1c29662f61c9dd26ef2c6c96b8fbb2eb7bd9 (diff)
downloadpoky-e8048a5b66d9833a9d41df3a160dd48e3de104b0.tar.gz
scripts/resulttool: call fixup_ptest_names in regression_common
ptests names not only need to be fixed for regression based on git testresults but also for testsresults provided "manually" Move ptests naming fixup in regression_common to share the fixup between both regression use cases (From OE-Core rev: f772ccd108dc3d618db9d479d672c0f3edd203ca) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/resulttool/regression.py41
1 files changed, 20 insertions, 21 deletions
diff --git a/scripts/lib/resulttool/regression.py b/scripts/lib/resulttool/regression.py
index 74fd5f3895..ad377c596b 100644
--- a/scripts/lib/resulttool/regression.py
+++ b/scripts/lib/resulttool/regression.py
@@ -206,12 +206,32 @@ def regression(args, logger):
206 206
207 regression_common(args, logger, base_results, target_results) 207 regression_common(args, logger, base_results, target_results)
208 208
209# Some test case naming is poor and contains random strings, particularly lttng/babeltrace.
210# Truncating the test names works since they contain file and line number identifiers
211# which allows us to match them without the random components.
212def fixup_ptest_names(results, logger):
213 for r in results:
214 for i in results[r]:
215 tests = list(results[r][i]['result'].keys())
216 for test in tests:
217 new = None
218 if test.startswith(("ptestresult.lttng-tools.", "ptestresult.babeltrace.", "ptestresult.babeltrace2")) and "_-_" in test:
219 new = test.split("_-_")[0]
220 elif test.startswith(("ptestresult.curl.")) and "__" in test:
221 new = test.split("__")[0]
222 if new:
223 results[r][i]['result'][new] = results[r][i]['result'][test]
224 del results[r][i]['result'][test]
225
209def regression_common(args, logger, base_results, target_results): 226def regression_common(args, logger, base_results, target_results):
210 if args.base_result_id: 227 if args.base_result_id:
211 base_results = resultutils.filter_resultsdata(base_results, args.base_result_id) 228 base_results = resultutils.filter_resultsdata(base_results, args.base_result_id)
212 if args.target_result_id: 229 if args.target_result_id:
213 target_results = resultutils.filter_resultsdata(target_results, args.target_result_id) 230 target_results = resultutils.filter_resultsdata(target_results, args.target_result_id)
214 231
232 fixup_ptest_names(base_results, logger)
233 fixup_ptest_names(target_results, logger)
234
215 matches = [] 235 matches = []
216 regressions = [] 236 regressions = []
217 notfound = [] 237 notfound = []
@@ -248,24 +268,6 @@ def regression_common(args, logger, base_results, target_results):
248 268
249 return 0 269 return 0
250 270
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
269def regression_git(args, logger): 271def regression_git(args, logger):
270 base_results = {} 272 base_results = {}
271 target_results = {} 273 target_results = {}
@@ -327,9 +329,6 @@ def regression_git(args, logger):
327 base_results = resultutils.git_get_result(repo, revs[index1][2]) 329 base_results = resultutils.git_get_result(repo, revs[index1][2])
328 target_results = resultutils.git_get_result(repo, revs[index2][2]) 330 target_results = resultutils.git_get_result(repo, revs[index2][2])
329 331
330 fixup_ptest_names(base_results, logger)
331 fixup_ptest_names(target_results, logger)
332
333 regression_common(args, logger, base_results, target_results) 332 regression_common(args, logger, base_results, target_results)
334 333
335 return 0 334 return 0