Repository navigation
Conversation
仓库的 workflow 全都只有 push 触发,pull request 页面上一个检查都没有, 评审看不到红绿灯,贡献者也不知道推上去的改动有没有跑过测试: - hosts、mobile、shells、ssh、sync、windows 六个测试 workflow 各加 pull_request,路径与 push 相同,来的活儿和推分支时一模一样;路径 列表因此在每个文件里出现两遍,各带上一行注释说明。release.yml 只跟 tag,不动。 - 新增 tests.yml:fmt、整 workspace 的 clippy、全量 cargo test --lib、 全量 UI 测试和外部 CLI 的测试,路径过滤 src/、tests/、crates/、 locales/、Cargo.* 等。这些以前要么只在 Windows 上跑一部分 (windows.yml),要么只跑两个组(shells.yml 的 terminal::run 和 zmodem):应用的单元测试和 UI 测试在 Linux 上从没整跑过。 UI 测试里跳过 projects::a_programs_title_names_the_terminal_until_it_ is_named_by_hand 一条:它在 main 上自己就 2 秒超时(对话框关不掉), 不跳过则每跑必红,workflow 的注释里写明了原因。 验证:七个 workflow 的 YAML 逐个解析通过;UI 测试在去掉 DISPLAY、 WAYLAND_DISPLAY 的环境里照常通过(GitHub 的 runner 没有显示服务器, 所以不能只按本机能跑来判断);cli_bin 在 Linux 上 4 条全过;fmt 干净。 推上 fork 后由 Actions 实跑确认。
tests.yml 第一次在 CI 上整跑,挂了三条,全部定性并修掉: - tmux::linux 的「没有 tmux」一段:删掉假 tmux 后 PATH 里还留着 /usr/bin,GitHub 的 runner 镜像自带 tmux 3.2a,真货顶替了假的, 断言 @@missing 必挂。这一段的 PATH 改成只给假工具那个目录;sh 是 按测试给的 PATH 找的,目录里补一个 /bin/sh 链接。 - terminal::engine 的 ZMODEM:transfer() 先发 ZmodemAsk 再置 transferring 标志,读到询问的一方可能在两步之间被调度走,看到「传输 还没开始」。改成先置位再发事件——答复与忙碌判断(run_command、 upload_dropped)本来就要求这个顺序。 - shellrs-mobile 的 pump:finish() 先唤醒读事件的一方,函数返回时才 关掉命令通道,于是 Exited 之后的 write 还会假装成功(数据进了没人 收的通道)。改成事件发出前先关通道,读到结尾时 write 必定是 Closed。 验证:tmux 8 条、sz_asks ×10、a_terminal_echoes ×10 本地全过;整 workspace clippy -D warnings、fmt 干净;UI 测试在去掉显示环境变量后 433 全过(skip 的那条是 main 上就挂的既有问题)。推上 fork 由 CI 实跑 复核。
This branch has not been deployed
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.
为什么
仓库的 7 个 workflow 全都只有
push触发,pull request 页面上一个检查都没有:评审看不到红绿灯,贡献者也不知道推上去的改动跑没跑过测试。这次给测试接上pull_request,并补一条以前没人整跑过的全量测试。改动
pull_request触发(hosts、mobile、shells、ssh、sync、windows),路径与各自push完全相同,来的活儿一模一样;每个加了一行注释说明路径为什么出现两遍。release.yml只跟 tag,没动。.github/workflows/tests.yml:cargo fmt --check→cargo clippy --all-targets -- -D warnings→ 全量cargo test --locked --lib→ 全量 UI 测试 →cargo test --locked --test cli_bin。这些以前要么只在 Windows 上跑一部分(windows.yml),要么只跑两个组(shells.yml的terminal::run/zmodem)——应用的单元测试和 UI 测试在 Linux 上从没整跑过。镜像和依赖包与shells.yml同款(ubuntu-22.04),带 rust-cache,路径过滤src/、tests/、crates/、locales/、Cargo.*等。projects::a_programs_title_names_the_terminal_until_it_is_named_by_hand在 main 的干净工作区上自己就 2 秒超时(对话框关不掉),不跳过则每跑必红;workflow 注释里写明了原因。这条本身值得单独修。已做的验证
on:块重复键检查;DISPLAY/WAYLAND_DISPLAY/XDG_SESSION_TYPE的环境里照常通过(GitHub 的 runner 没有显示服务器,不能只按本机能跑来判断);cli_bin在 Linux 上 4 条全过(此前只有 Windows CI 跑它);cargo fmt --check干净;ssh、hosts、sync、shells、tests、mobile(androidjob)全部成功;mobile的iosjob 曾被 GitHub 以「runner 容量不足、job was not acquired」取消,属平台侧问题,与代码无关。已知取舍
push/pull_request各一份),以后改触发路径要改两处;push又开着 PR 时会跑两遍(fork 的 PR 不会,fork 的 push 不上报到 PR 页面);windows.yml的触发路径历来不含它自己的文件,沿用原样,所以这次对它的改动靠 YAML 校验把关,没有在实跑里触发过。实跑结果(commit
87d27ec)PR 侧 7 项检查全部通过:
testsfmt --check·clippy --all-targets -D warnings· 全量--lib852 条 · 全量 UI 433 条(skip 1)·cli_bin4 条shellshosts/ssh/syncios/android全量测试第一次在 CI 上跑,暴露了三个问题,已在第二个提交(
87d27ec)修复:tmux::linux测试的环境假设(确定性失败):「没有 tmux」那一段删掉假 tmux 后 PATH 里还留着/usr/bin,而 GitHub 的 runner 镜像自带 tmux 3.2a,真货顶替了假的。改成这一段 PATH 只给假工具目录,目录里补一个/bin/sh链接(testing::sh按测试给的 PATH 找sh)。transferring竞态(高负载偶发):Parser::transfer先发ZmodemAsk事件、下一行才置transferring标志,读到询问的一方可能在两步之间被调度走。改成先置位再发事件——zmodem_reply/run_command/upload_dropped的忙碌判断本来就要求这个顺序。shellrs-mobile的 Exited 后写入竞态(偶发):pump里finish()先唤醒读事件的一方,函数返回时才关掉命令通道,Exited之后的write会假装成功。改成事件发出前先commands.close(),读到结尾时write必定返回Closed。修复的本地验证:三条相关测试 ×10 轮全过、整 workspace clippy / fmt 干净、UI 测试在去掉显示环境变量的环境里 433 全过;随后 PR 侧 CI 实跑复核通过。