summaryrefslogtreecommitdiffstats
path: root/scripts
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:58:28 +0000
commit541a2e2683531355e678fd93524a0c4a8c43a8ff (patch)
tree5f2f80d8ad13b5fce311cfa9bd70fe6ce7d521d5 /scripts
parent4dbbf2f4a85620a08dc2fa65095dc17fe6c530f8 (diff)
downloadopenembedded-core-contrib-541a2e2683531355e678fd93524a0c4a8c43a8ff.tar.gz
resulttool/regression: Improve matching of poor ptest test names
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-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):
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 = {}
@@ -309,6 +327,9 @@ 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