From 52c604342cc8c39022734211307381ab01f99104 Mon Sep 17 00:00:00 2001 From: Alison Shao <54658187+alisonshao@users.noreply.github.com> Date: Sun, 4 Jan 2026 11:52:52 -0800 Subject: [PATCH] chore: print test list at beginning and end of run_suite.py (#16334) Co-authored-by: Mick --- .../sglang/multimodal_gen/test/run_suite.py | 19 ++++++++++++ test/srt/run_suite.py | 30 ++++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/python/sglang/multimodal_gen/test/run_suite.py b/python/sglang/multimodal_gen/test/run_suite.py index dd5ece7b5..e02496521 100644 --- a/python/sglang/multimodal_gen/test/run_suite.py +++ b/python/sglang/multimodal_gen/test/run_suite.py @@ -14,6 +14,8 @@ import subprocess import sys from pathlib import Path +import tabulate + from sglang.multimodal_gen.runtime.utils.logging_utils import init_logger logger = init_logger(__name__) @@ -256,6 +258,15 @@ def main(): if i % args.total_partitions == args.partition_id ] + # Print test info at beginning (similar to test/run_suite.py pretty_print_tests) + partition_info = f"{args.partition_id + 1}/{args.total_partitions} (0-based id={args.partition_id})" + headers = ["Suite", "Partition"] + rows = [[args.suite, partition_info]] + msg = tabulate.tabulate(rows, headers=headers, tablefmt="psql") + "\n" + msg += f"✅ Enabled {len(my_items)} test(s):\n" + for item in my_items: + msg += f" - {item}\n" + print(msg, flush=True) print( f"Suite: {args.suite} | Partition: {args.partition_id}/{args.total_partitions}" ) @@ -271,6 +282,14 @@ def main(): # 4. execute with the specific test items exit_code = run_pytest(my_items) + + # Print tests again at the end for visibility + msg = "\n" + tabulate.tabulate(rows, headers=headers, tablefmt="psql") + "\n" + msg += f"✅ Executed {len(my_items)} test(s):\n" + for item in my_items: + msg += f" - {item}\n" + print(msg, flush=True) + sys.exit(exit_code) diff --git a/test/srt/run_suite.py b/test/srt/run_suite.py index 0ebac3879..eea5b3468 100644 --- a/test/srt/run_suite.py +++ b/test/srt/run_suite.py @@ -2,6 +2,8 @@ import argparse import glob from pathlib import Path +import tabulate + from sglang.test.ci.ci_utils import TestFile, run_unittest_files # NOTE: please sort the test cases alphabetically by the test file name @@ -523,7 +525,25 @@ def main(): if args.auto_partition_size: files = auto_partition(files, args.auto_partition_id, args.auto_partition_size) - print("The running tests are ", [f.name for f in files]) + # Print test info at beginning (similar to test/run_suite.py pretty_print_tests) + if args.auto_partition_size: + partition_info = ( + f"{args.auto_partition_id + 1}/{args.auto_partition_size} " + f"(0-based id={args.auto_partition_id})" + ) + else: + partition_info = "full" + + headers = ["Suite", "Partition"] + rows = [[args.suite, partition_info]] + msg = tabulate.tabulate(rows, headers=headers, tablefmt="psql") + "\n" + + total_est_time = sum(f.estimated_time for f in files) + msg += f"✅ Enabled {len(files)} test(s) (est total {total_est_time:.1f}s):\n" + for f in files: + msg += f" - {f.name} (est_time={f.estimated_time})\n" + + print(msg, flush=True) # Add extra timeout when retry is enabled timeout = args.timeout_per_file @@ -538,6 +558,14 @@ def main(): args.max_attempts, args.retry_wait_seconds, ) + + # Print tests again at the end for visibility + msg = "\n" + tabulate.tabulate(rows, headers=headers, tablefmt="psql") + "\n" + msg += f"✅ Executed {len(files)} test(s) (est total {total_est_time:.1f}s):\n" + for f in files: + msg += f" - {f.name} (est_time={f.estimated_time})\n" + print(msg, flush=True) + exit(exit_code)