Repository navigation
ci: 避免重复运行 Python 测试 - #23
Merged
Merged
Conversation
mtmtian
commented
Oct 2, 2026
mtmtian
left a comment
Owner
Author
There was a problem hiding this comment.
审查对象:HEAD 23ac2e01c39774141733c3c233b9c973e312555a,相对 main 30e9c32f574a4d1a2bcd843fbcbe083421111cb5 的完整差异。普通代码审查未发现阻断问题。
- 仅修改 CI 文件;版本固定、下载校验、触发条件、权限、超时及 Worker 检查保持不变。
MIHOMO_BIN/MIHOMO_DATA_DIR在测试步骤显式设置,并指向准备步骤写入的同一 runner 临时目录。准备失败会阻断后续测试。- 全量发现仍覆盖全部 121 个测试;已核对 CI 日志,6 个依赖 Mihomo 的测试均实际通过,零跳过。
- 通过单次全量执行消除重复测试,没有删除断言、筛除测试或引入额外依赖。
当前两个 CI 任务均成功,PR 状态为 CLEAN,可按已授权流程合并。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
现有 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 秒;这是两次实际运行的对比,未进行多轮基准测试。