diff options
authorAlexis Lothoré <>2023-10-22 19:49:38 +0200
committerRichard Purdie <>2023-10-23 10:49:17 +0100
commitd3f536b3fc3f7027f6f5cf8bdaf5d7c050c7974b (patch)
parent6de4426d9a7da67deed7d3a3918892fb56238ff3 (diff)
scripts/yocto_testresults_query: add option to change display limit
Add a "-l"/"--limit" option to allow changing the display limit in resulttool. - If no value is passed, resulttool uses its default value. - If 0 is passed, the display limit is removed and every regression will be displayed - If a custom value is passed, this value overrides the vlaue configured in resulttool Signed-off-by: Alexis Lothoré <> Signed-off-by: Alexandre Belloni <>
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/ b/scripts/
index a5073736aa..521ead8473 100755
--- a/scripts/
+++ b/scripts/
@@ -56,9 +56,12 @@ def fetch_testresults(workdir, sha1):
subprocess.check_call(["git", "fetch", "--depth", "1", "origin", f"{rev}:{rev}"], cwd=workdir)
return branch
-def compute_regression_report(workdir, basebranch, baserevision, targetbranch, targetrevision):
+def compute_regression_report(workdir, basebranch, baserevision, targetbranch, targetrevision, args):"Running resulttool regression between SHA1 {baserevision} and {targetrevision}")
- report = subprocess.check_output([resulttool, "regression-git", "--branch", basebranch, "--commit", baserevision, "--branch2", targetbranch, "--commit2", targetrevision, workdir]).decode("utf-8")
+ command = [resulttool, "regression-git", "--branch", basebranch, "--commit", baserevision, "--branch2", targetbranch, "--commit2", targetrevision, workdir]
+ if args.limit:
+ command.extend(["-l", args.limit])
+ report = subprocess.check_output(command).decode("utf-8")
return report
def print_report_with_header(report, baseversion, baserevision, targetversion, targetrevision):
@@ -85,7 +88,7 @@ def regression(args):
basebranch = fetch_testresults(workdir, baserevision)
targetbranch = fetch_testresults(workdir, targetrevision)
- report = compute_regression_report(workdir, basebranch, baserevision, targetbranch, targetrevision)
+ report = compute_regression_report(workdir, basebranch, baserevision, targetbranch, targetrevision, args)
print_report_with_header(report, args.base, baserevision,, targetrevision)
if not args.testresultsdir:
@@ -109,6 +112,10 @@ def main():
help=f"An existing test results directory. {sys.argv[0]} will automatically clone it and use default branch if not provided")
+ parser_regression_report.add_argument(
+ '-l',
+ '--limit',
+ help=f"Maximum number of changes to display per test. Can be set to 0 to print all changes")
args = parser.parse_args()