Skip to content

ci: 补一道跑后端单测的工作流(594 个测试此前没有任何工作流执行) - #311

Open
enen31255 wants to merge 1 commit into
aimod-cc:mainfrom
enen31255:ci-server-tests
Open

enen31255 wants to merge 1 commit into
aimod-cc:mainfrom
enen31255:ci-server-tests

Conversation

@enen31255

@enen31255 enen31255 commented Oct 17, 2026 •

Copy link
Copy Markdown

为什么
仓库里有 594 个测试(507 个 #[test] + 87 个 #[tokio::test]),全部集中在 agent2api-server 这个 crate(桌面壳 src/ 下 0 个)。
但目前没有任何工作流执行它们:build.yml / docker.yml 只在打 tag 或手动触发时出包,
warm-cache.yml 只预热依赖缓存,frontend-artifacts.yml 只校验前端产物同源。
也就是说改动要等装到用户机器上才第一次真正被测试跑过。

这条 PR 加什么
一个 server-tests.yml:push/pull_request 到 main、beta 时跑 cargo test -p agent2api-server。
触发方式与 permissions 照抄 frontend-artifacts.yml,工具链与 rust-cache 配置口径照抄 build.yml。

为什么只测后端 crate
桌面壳是 Tauri,在 Linux runner 上要 webkit2gtk / gtk3 一整套系统库;
而 server/Cargo.toml 的注释写明拆分目的正是「headless 一个都不用」、
依赖里「刻意没有的:tauri 及其插件」。为 0 个测试去背那套依赖不值得,而全部 594 个测试已经在 server crate 里。
同理没加 --all-features:本仓库没有既有的 feature 组合验证约定,打开可能引入新的系统库/网络依赖,让这道闸变成噪音。

诚实说明
这份 workflow 我没在真实 CI 上跑过(我这边没有 Rust 工具链,也没推送权限)。
需要确认两点:Swatinem/rust-cache@v2 的 workspaces 路径写法是否与你 build.yml 的实际 target-dir 一致;
以及 594 个测试里有没有依赖真实网络或本机绝对路径的(那类用例在 runner 上会挂,我本地跑不出来)。
如果 base 应该走 beta 而不是 main,说一声我改。

@enen31255
enen31255 marked this pull request as ready for review October 17, 2026 03:20
@enen31255 enen31255 changed the title ci: 补一道跑后端单测的工作流(507 个 #[test] 此前没有任何工作流执行) ci: 补一道跑后端单测的工作流(594 个测试此前没有任何工作流执行) Oct 17, 2026
@enen31255
enen31255 marked this pull request as draft October 17, 2026 03:28
@enen31255
enen31255 marked this pull request as ready for review October 17, 2026 03:34
xiarunjie added a commit to xiarunjie/Agent2API that referenced this pull request Nov 3, 2026
xiarunjie added a commit to xiarunjie/Agent2API that referenced this pull request Nov 4, 2026
本提交把 main 的内容整体切到上游 v3.4.0 的发布状态(tag v3.4.0 = 31bc7bd,其后
0add462 重建了手机端与 Service Worker 产物并把版本号跟到 3.4.0):

  · 此前在 beta.6 基线上同步进来的 8 条上游 PR 内容(aimod-cc#305 aimod-cc#311 aimod-cc#343 aimod-cc#415 aimod-cc#417
    aimod-cc#418 aimod-cc#434 aimod-cc#449)不再出现在 main 上 —— 它们都改在 beta.6 的旧落点,其中相当
    一部分与 3.4.0 自带的实现(路由工作台、会话图片压缩)在同一批文件上各走了
    一条路(实测 43 个文件内容分叉)。旧状态完整保留在 archive-main-pre-340
    (分支与 tag 同名),需要时可逐条取回。
  · 前端产物取自上游 3.4.0 自己的构建结果,与上游源码逐字节同源。
  · 基线切齐后,「哪些上游 PR 还能合」可用硬证据重新判定,而不是在分叉状态上叠。

上游对照:aimod-cc/Agent2API @ 0add462(tree 4ffbf15)
xiarunjie added a commit to xiarunjie/Agent2API that referenced this pull request Nov 4, 2026
升级到 3.4.0 后 main 上没有 .github/workflows/server-tests.yml —— 上游尚未合并
aimod-cc#311,3.4.0 的发版里也就没有这道闸(594 个后端测试此前没有任何工作流执行)。
该 PR 相对当前基线仍可干净合并(mergeable=true),其内容与本文件一致。
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