From 4bb4d68793c61cbe92aa6a2d5a8ea237fa87ef9e Mon Sep 17 00:00:00 2001 From: Patrick Roy Date: Tue, 21 Nov 2023 10:04:38 +0000 Subject: [PATCH] test: Fix default handling of pipeline_perf --test argument argparse's `action="append"` interacts unexpectedly with default arguments, in the sense that it will _always_ include the default arguments in the resulting list, and then appends any actually specified argument to the default list. This meant that doing something like `.buildkite/pipeline_perf.py --test memory-overhead` will first cause steps for _every_ performance test be added, and then another copy of the memory overhead step. (cherry picked from commit 959ecdd19441c8d3b3b86ef8334111a5549f04c4) Signed-off-by: Patrick Roy --- .buildkite/pipeline_perf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipeline_perf.py b/.buildkite/pipeline_perf.py index e057e4d891a..d9c46da4375 100755 --- a/.buildkite/pipeline_perf.py +++ b/.buildkite/pipeline_perf.py @@ -61,15 +61,15 @@ def build_group(test): parser = COMMON_PARSER parser.add_argument( "--test", - required=True, choices=list(perf_test.keys()), + required=False, help="performance test", action="append", ) parser.add_argument("--retries", type=int, default=0) args = parser.parse_args() group_steps = [] -tests = [perf_test[test] for test in args.test] +tests = [perf_test[test] for test in args.test or perf_test.keys()] for test_data in tests: test_data.setdefault("platforms", args.platforms) test_data.setdefault("instances", args.instances)