From 0e2a0260a150aff50b05bbac3c88fa935e264235 Mon Sep 17 00:00:00 2001 From: Liangsheng Yin Date: Tue, 7 Apr 2026 15:56:12 -0700 Subject: [PATCH] Add fast-fail to multimodal-gen CI (#22284) --- .github/workflows/pr-test-multimodal-gen.yml | 1 + python/sglang/multimodal_gen/test/run_suite.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-test-multimodal-gen.yml b/.github/workflows/pr-test-multimodal-gen.yml index a91b6c2e9..4b560ed5d 100644 --- a/.github/workflows/pr-test-multimodal-gen.yml +++ b/.github/workflows/pr-test-multimodal-gen.yml @@ -175,6 +175,7 @@ jobs: with: ref: ${{ inputs.pr_head_sha || inputs.git_ref || github.sha }} + - uses: ./.github/actions/check-stage-health - uses: ./.github/actions/check-maintenance diff --git a/python/sglang/multimodal_gen/test/run_suite.py b/python/sglang/multimodal_gen/test/run_suite.py index 700d4d6b8..a6fef42e8 100644 --- a/python/sglang/multimodal_gen/test/run_suite.py +++ b/python/sglang/multimodal_gen/test/run_suite.py @@ -174,12 +174,14 @@ def collect_test_items(files, filter_expr=None): return test_items -def run_pytest(files, filter_expr=None): +def run_pytest(files, filter_expr=None, exitfirst=False): if not files: print("No files to run.") return 0 base_cmd = [sys.executable, "-m", "pytest", "-s", "-v"] + if exitfirst: + base_cmd.append("-x") # Add pytest -k filter if provided if filter_expr: @@ -349,7 +351,8 @@ def main(): print(f"Running {len(my_items)} items in this shard: {', '.join(my_items)}") # 4. execute with the specific test items - exit_code = run_pytest(my_items) + # Fast-fail: stop on first failure unless --continue-on-error is set + exit_code = run_pytest(my_items, exitfirst=not args.continue_on_error) # Print tests again at the end for visibility msg = "\n" + tabulate.tabulate(rows, headers=headers, tablefmt="psql") + "\n"