chore: print test list at beginning and end of run_suite.py (#16334)

Co-authored-by: Mick <mickjagger19@icloud.com>
This commit is contained in:
Alison Shao
2026-01-04 11:52:52 -08:00
committed by GitHub
co-authored by Mick
parent ff0f370f85
commit 52c604342c
2 changed files with 48 additions and 1 deletions
@@ -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)
+29 -1
View File
@@ -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)