Skip to content

Commit

Permalink
test: Fix default handling of pipeline_perf --test argument
Browse files Browse the repository at this point in the history
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 959ecdd)

Signed-off-by: Patrick Roy <[email protected]>
  • Loading branch information
roypat authored and wearyzen committed Jan 23, 2024
1 parent 48dcdae commit 7ae378a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .buildkite/pipeline_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7ae378a

Please sign in to comment.