summaryrefslogtreecommitdiffstats
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:36:44 +0000
commitf772ccd108dc3d618db9d479d672c0f3edd203ca (patch)
tree0706a9e69dcf6c24a4db62e24b0d922df520913b
parent65ca2c4b7349a4f7dcfcc580d926a99c673deb60 (diff)
downloadopenembedded-core-f772ccd108dc3d618db9d479d672c0f3edd203ca.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 Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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):
regression_common(args, logger, base_results, target_results)
+# Some test case naming is poor and contains random strings, particularly lttng/babeltrace.
+# Truncating the test names works since they contain file and line number identifiers
+# which allows us to match them without the random components.
+def fixup_ptest_names(results, logger):
+ for r in results:
+ for i in results[r]:
+ tests = list(results[r][i]['result'].keys())
+ for test in tests:
+ new = None
+ if test.startswith(("ptestresult.lttng-tools.", "ptestresult.babeltrace.", "ptestresult.babeltrace2")) and "_-_" in test:
+ new = test.split("_-_")[0]
+ elif test.startswith(("ptestresult.curl.")) and "__" in test:
+ new = test.split("__")[0]
+ if new:
+ results[r][i]['result'][new] = results[r][i]['result'][test]
+ del results[r][i]['result'][test]
+
def regression_common(args, logger, base_results, target_results):
if args.base_result_id:
base_results = resultutils.filter_resultsdata(base_results, args.base_result_id)
if args.target_result_id:
target_results = resultutils.filter_resultsdata(target_results, args.target_result_id)
+ fixup_ptest_names(base_results, logger)
+ fixup_ptest_names(target_results, logger)
+
matches = []
regressions = []
notfound = []
@@ -248,24 +268,6 @@ def regression_common(args, logger, base_results, target_results):
return 0
-# Some test case naming is poor and contains random strings, particularly lttng/babeltrace.
-# Truncating the test names works since they contain file and line number identifiers
-# which allows us to match them without the random components.
-def fixup_ptest_names(results, logger):
- for r in results:
- for i in results[r]:
- tests = list(results[r][i]['result'].keys())
- for test in tests:
- new = None
- if test.startswith(("ptestresult.lttng-tools.", "ptestresult.babeltrace.", "ptestresult.babeltrace2")) and "_-_" in test:
- new = test.split("_-_")[0]
- elif test.startswith(("ptestresult.curl.")) and "__" in test:
- new = test.split("__")[0]
- if new:
- results[r][i]['result'][new] = results[r][i]['result'][test]
- del results[r][i]['result'][test]
-
-
def regression_git(args, logger):
base_results = {}
target_results = {}
@@ -327,9 +329,6 @@ def regression_git(args, logger):
base_results = resultutils.git_get_result(repo, revs[index1][2])
target_results = resultutils.git_get_result(repo, revs[index2][2])
- fixup_ptest_names(base_results, logger)
- fixup_ptest_names(target_results, logger)
-
regression_common(args, logger, base_results, target_results)
return 0