Skip to content

test: 宿主端到端测试和功能矩阵移到插件仓库 - #5

Draft
xiaoyumuxi wants to merge 1 commit into
mainfrom
test/host-e2e-and-feature-matrix
Draft

xiaoyumuxi wants to merge 1 commit into
mainfrom
test/host-e2e-and-feature-matrix

Conversation

@xiaoyumuxi

Copy link
Copy Markdown
Contributor

关联:1lck/Lithe-IDEA#1915(插件的测试、功能矩阵和翻译只在插件仓库,宿主零依赖)

改动

主仓库在 #1915 删掉了 Go Support 的宿主端到端测试和功能矩阵条目。这个 PR 把它们接到插件仓库:

  • 宿主端到端测试 e2e/host/desktop/internal/workbench/official_go_plugin_e2e_test.go
    • 来源:主仓库 desktop/internal/workbench/official_plugins_e2e_test.go(1lck/Lithe-IDEA@b582e206a)里的
      TestOfficialGoPluginBuildsAndServesAModule,以及它用到的辅助函数(安装插件包、安装目录摘要、等构建模型、跑任务和运行入口、改插件设置)。
    • 只改了一处名字:writeFixture 改为 writePluginFixture,因为宿主同一个包里现在有同名函数。测试逻辑没有改。
  • 运行脚本 scripts/e2e-host.mjs 和宿主版本固定文件 e2e/host/lithe-host.json
    • 测试用的是宿主内部(未导出)的测试工具,只能在宿主的 desktop/internal/workbench 包里编译。
    • 脚本把 lithe-host.json 固定的宿主 commit(059d878d4)稀疏检出到 .artifacts/lithe-host(只取 desktop/ 和 scripts/),
      复制 e2e/host/desktop/ 下的测试到同一路径,再运行宿主的 scripts/desktop/desktop-go.sh test,后者会构建宿主固定的 Rust Core。
    • 主仓库不读取插件仓库,依赖方向是插件 → 宿主的某个固定 commit。
    • requiredEnvironment 里的变量没设置时直接报错,不让测试因缺少插件包而跳过、看起来像通过。
    • --ref 换宿主版本试跑(比如未合入的宿主分支),--run 只跑部分测试。
  • 功能矩阵 docs/feature-matrix.md
    • 迁移主仓库 shared/platform-feature-matrix/features/go-support-plugin.json,状态取值沿用主仓库。
    • 原条目写的是旧 Swift 宿主的官方包迁移流程和 Viva 宿主当时没有运行/测试入口的状态,都已过时;按当前插件 0.0.1 和宿主 059d878d4 重写。
    • macOS:implemented / pending(自动化测试通过,手工验收没做,不标 verified);Windows:missing(只发布 darwin 包)。
  • README 增加“宿主端到端测试”“功能矩阵”两节;.gitignore 忽略 .artifacts/。

没有改 CI:这个测试要 go、gopls 和 Rust 工具链,和在主仓库时一样手动运行。

验证

2026-11-14,macOS arm64,插件 v0.0.1 发布包:

LITHE_TEST_GO_PLUGIN_ARCHIVE=<go-support-0.0.1-darwin.zip 的绝对路径> node scripts/e2e-host.mjs
  • 首次运行(空的 .artifacts/lithe-host,从检出宿主、构建 Core 开始):TestOfficialGoPluginBuildsAndServesAModule PASS(5.15s),gopls 诊断 undefined: missingCall。
  • 复用已有检出再跑一次:PASS(6.95s)。
  • gofmt -l e2e/ 无输出;node scripts/package.mjs 正常,包里不含 e2e/。

评审注意

  • 升级 lithe-host.json 的 revision 时,宿主测试工具(newHarness、awaitStateWithin 等)的改动可能要求同步修改测试。
  • 同样的 scripts/e2e-host.mjs 会放进 Java、Maven、Cargo、LLDB 插件仓库,各自的 PR 只改 e2e/host/ 里的内容。

主仓库按 1lck/Lithe-IDEA#1915 不再保存插件的测试和功能矩阵条目,这里接收 Go Support 的部分:

- e2e/host/ 放 TestOfficialGoPluginBuildsAndServesAModule 和它用到的辅助函数,
  scripts/e2e-host.mjs 把 lithe-host.json 固定的宿主版本检出到 .artifacts/lithe-host 后运行
- docs/feature-matrix.md 迁移 go-support-plugin 条目,按当前插件重写
- README 说明运行方式,.gitignore 忽略 .artifacts/
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