Repository navigation
test(ci): 修复 preview 上的格式和跨平台测试失败 - #1723
Merged
Merged
Conversation
这些失败都来自 preview,会拦住所有基于它的 PR: - rustfmt:格式化 #1717、#1718 留下的 git/mod.rs 和 dispatcher.rs。 - Windows Rust:request_trace 测试用 Windows 下不算绝对路径的 /tmp/project;core_request_traces 测试的临时目录在 home 下, 脱敏结果是 <HOME>\...,不是 <PATH>。 - macOS Swift:日志窗口测试改成带标题栏的窗口后,AppKit 会把它压进 CI 的 1024x768 屏幕;测试窗口改为不受屏幕限制。 - Windows 前端:lossy-rollback-channel 的 mock 补上 #1717 新增的 git.resolveFileContext。 只改测试和格式,不改产品行为。
xiaoyumuxi
marked this pull request as ready for review
November 4, 2026 08:30
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.
背景
preview 上有 4 类 CI 失败,基于它的 PR 都会被拦。#1720 合并时最后一轮的失败项就是这些:CI tooling tests、Test Windows frontend、Test Windows Rust implementation (shared-1);Swift tests 那一轮被取消,它的失败来自更早一轮的完整 CI。
这个 PR 只改测试和格式,不改产品行为。
改动
rustfmt(CI tooling tests)
rust/lithe-core/src/git/mod.rs、rust/lithe-core/src/runtime/dispatcher.rs:格式化 fix(git): 按文件实际归属解析仓库 #1717、fix(git): 保留刷新失败仓库的已确认状态 #1718 留下的差异,没有逻辑变化。Windows Rust
rust/lithe-core/src/diagnostics/request_trace.rs:测试fields_keep_valid_tokens_and_omit_invalid_ones用的/tmp/project在 Windows 上Path::is_absolute为 false,字段被丢弃。改成按平台取路径(Windows 用C:\project)。rust/lithe-core/src/tests/core_request_traces.rs:Windows runner 的临时目录在 home 下,脱敏结果是<HOME>\...,不是<PATH>。断言改成两种都接受,后面“序列化结果不包含真实路径”的检查保留。这个失败之前被上一条盖住了,Rust 测试 harness 遇到首个失败就停。macOS Swift
macos/Tests/LitheTests/DiagnosticsWorkflowTests.swift:logWindowMatchesMockup的窗口改成带标题栏后,AppKit 上屏时会把它压进屏幕范围,CI 的 1024×768 屏幕放不下测试要的尺寸(1340×786 被压成 1024×642)。新增只在测试里用的ScreenUnconstrainedWindow,重写constrainFrameRect(_:to:)保持原尺寸。没有把窗口移出屏幕,也不改LITHE_TEST_WINDOW_MODE=isolated的隔离方式。Windows 前端
windows/tauri/src/features/git/utils/lossy-rollback-channel.test.ts:mock 补上 fix(git): 按文件实际归属解析仓库 #1717 新增的git.resolveFileContext。修复前这个文件 6 个用例全部报Unexpected command: git.resolveFileContext。为什么 preview 没拦住
skipped,docs(skills): 新增 create-lithe-plugin Skill,规定插件日志接线 #1713 那次的提交是纯文档,同样没有跑测试。matrix-exempt矩阵门禁按路径判断,测试和纯格式改动也要求能力记录有实质变更。这个 PR 没有用户可观察的变化,不应该改能力记录,所以用
matrix-exempt(先例:#1333、#1361)。标签由 PR 发起方确认后添加,请 reviewer 复核这一判断。验证
变基到
f8d1fb8ee后本地通过:scripts/rust-core/verify-rust-core-static.sh(含 rustfmt)lossy-rollback-channel.test.ts6 个用例--filter 'DiagnosticsWorkflowTests'整组变基前本地通过:
verify-rust-core.sh全量(lithe-core 1725 个单元测试及其余 Rust 测试)bun run typecheckverify-windows-boundaries.sh、verify-test-stability.sh、verify-platform-feature-matrix.sh本地没有覆盖的部分
观察到但没有改的问题
logWindowMatchesMockup第 218 行在本机负载 28-35 时超过 5 秒等待失败过一次,当时整体慢约 13 倍。这行在本次改动之前,之后 3 次同条件运行都通过,其中 1 次降到后台优先级(慢约 3.5 倍)也没能复现。高负载只是推测,5 秒期限没有动。built_application_early_askpass_modes在本机负载约 60 时超时一次(5015ms),单独重跑 118ms 通过。git_patch_exchange::shelf_restore_conflict_preserves_worktree_and_allows_retry_after_resolution接近 15000ms 预算(feat(plugins): #1495 Maven 模型、配置、测试与服务运行迁移(阶段 D 进行中) #1558 上 15284ms 失败,feat(logging): 声明式插件由执行方代记插件操作事实 #1720 上 11442ms 通过)。