Skip to content

ci: 避免重复运行 Python 测试 - #23

Merged
mtmtian merged 1 commit into
mainfrom
codex-mt/ci-single-test-pass
Oct 2, 2026
Merged

mtmtian merged 1 commit into
mainfrom
codex-mt/ci-single-test-pass

Conversation

@mtmtian

@mtmtian mtmtian commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

现有 CI 先运行全量 Python 测试,再运行 Mihomo 与聚合测试,导致 24 个已通过的聚合测试重复执行。本次仅调整 CI 顺序:先准备原有固定版本的 Mihomo 和数据文件,再为全量测试设置 MIHOMO_BIN / MIHOMO_DATA_DIR,一次运行所有 test_*.py。保留 Shell 语法检查、profiles 跟踪检查和独立 Worker 任务;不增加依赖或测试。

验证提交:23ac2e01c39774141733c3c233b9c973e312555a。GitHub Linux CI 全部通过:python3 -m unittest discover -s tests -p 'test_*.py' -v 运行 121 个测试、零跳过,包括 6 个 Mihomo 配置/实际路由测试;Shell 语法、profiles 跟踪检查及 Worker 的 npm test 均通过。本地 actionlint .github/workflows/ci.yml(1.7.12)和 git diff --check 也通过。部署代码任务本次耗时 50 秒,上次主分支为 69 秒;这是两次实际运行的对比,未进行多轮基准测试。

@mtmtian mtmtian left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查对象:HEAD 23ac2e01c39774141733c3c233b9c973e312555a,相对 main 30e9c32f574a4d1a2bcd843fbcbe083421111cb5 的完整差异。普通代码审查未发现阻断问题。

  • 仅修改 CI 文件;版本固定、下载校验、触发条件、权限、超时及 Worker 检查保持不变。
  • MIHOMO_BIN / MIHOMO_DATA_DIR 在测试步骤显式设置,并指向准备步骤写入的同一 runner 临时目录。准备失败会阻断后续测试。
  • 全量发现仍覆盖全部 121 个测试;已核对 CI 日志,6 个依赖 Mihomo 的测试均实际通过,零跳过。
  • 通过单次全量执行消除重复测试,没有删除断言、筛除测试或引入额外依赖。

当前两个 CI 任务均成功,PR 状态为 CLEAN,可按已授权流程合并。

@mtmtian
mtmtian merged commit 1cf77e2 into main Oct 2, 2026
2 checks passed
@mtmtian
mtmtian deleted the codex-mt/ci-single-test-pass branch October 2, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant