[CI] Parallelize unit tests in CI (#1219)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import argparse
|
||||
import glob
|
||||
import multiprocessing as mp
|
||||
|
||||
from sglang.test.test_utils import run_unittest_files
|
||||
|
||||
@@ -49,6 +48,18 @@ if __name__ == "__main__":
|
||||
choices=list(suites.keys()) + ["all"],
|
||||
help="The suite to run",
|
||||
)
|
||||
arg_parser.add_argument(
|
||||
"--range-begin",
|
||||
type=int,
|
||||
default=0,
|
||||
help="The begin index of the range of the files to run.",
|
||||
)
|
||||
arg_parser.add_argument(
|
||||
"--range-end",
|
||||
type=int,
|
||||
default=None,
|
||||
help="The end index of the range of the files to run.",
|
||||
)
|
||||
args = arg_parser.parse_args()
|
||||
|
||||
if args.suite == "all":
|
||||
@@ -56,5 +67,7 @@ if __name__ == "__main__":
|
||||
else:
|
||||
files = suites[args.suite]
|
||||
|
||||
files = files[args.range_begin : args.range_end]
|
||||
|
||||
exit_code = run_unittest_files(files, args.timeout_per_file)
|
||||
exit(exit_code)
|
||||
|
||||
Reference in New Issue
Block a user