From f5581ac3dadeb1fb348ba311d9f0ecd6b5ea0ea4 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Sun, 19 Jul 2026 19:54:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E5=A2=9E=E9=87=8F=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E8=84=9A=E6=9C=AC=E8=BF=87=E6=BB=A4=E5=B7=B2?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=9A=84=E6=B5=8B=E8=AF=95=E6=96=87=E4=BB=B6?= =?UTF-8?q?=20(#610)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: xiaoxia Co-committed-by: xiaoxia --- scripts/ci/select_unit_tests.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/ci/select_unit_tests.py b/scripts/ci/select_unit_tests.py index edc0bb8a2..90f3d50ee 100644 --- a/scripts/ci/select_unit_tests.py +++ b/scripts/ci/select_unit_tests.py @@ -158,10 +158,13 @@ def select_tests(changed_files): source_file_changes = [] for f in changed_files: - # 测试文件本身改动 + # 测试文件本身改动(仅保留仍存在的文件,删除的测试文件不加入运行列表) if f.startswith("tests/unit/test_") and f.endswith(".py"): - test_file_changes.append(f) - selected.add(f) + if (ROOT / f).exists(): + test_file_changes.append(f) + selected.add(f) + else: + print(f"[skip-deleted] 测试文件已删除,跳过: {f}") # 源码文件改动 elif f.endswith(".py"): source_file_changes.append(f)