Skip to content

test(core): align Vertex auth test with content interface - #9899

Closed
yu-xin-c wants to merge 1 commit into
QwenLM:mainfrom
yu-xin-c:codex/fix-vertex-test-after-interface-shrink
Closed

test(core): align Vertex auth test with content interface#9899
yu-xin-c wants to merge 1 commit into
QwenLM:mainfrom
yu-xin-c:codex/fix-vertex-test-after-interface-shrink

Conversation

@yu-xin-c

Copy link
Copy Markdown
Contributor

What this PR does

Updates the remaining Vertex auth lazy-construction test to exercise embedContent, the same surviving ContentGenerator operation used by the rest of the #9676 test migration.

Why it's needed

#9676 removed countTokens from ContentGenerator, but a Vertex ADC test added independently on main retained one generator.countTokens(...) call. As a result, current main fails during npm ci, build, and typecheck with TS2339 at contentGenerator.test.ts:776. The PR's own sandboxed verification had already captured the integration failure here.

Reviewer Test Plan

How to verify

  1. On current main, run npm run build --workspace packages/core and observe Property 'countTokens' does not exist on type 'ContentGenerator'.
  2. On this branch, run cd packages/core && npx vitest run src/core/contentGenerator.test.ts --maxWorkers=1 and confirm all 27 tests pass.
  3. Run npm run typecheck and confirm every workspace plus typecheck:integration passes.

Evidence (Before & After)

N/A for UI. Before: core compilation stops at contentGenerator.test.ts:776 with TS2339. After: the full repository build completes during npm ci, the focused file passes 27/27, and workspace plus integration typecheck completes successfully.

Tested on

OS Status
🍏 macOS
🪟 Windows N/A
🐧 Linux N/A

Environment (optional)

Node.js 22.22.2 on macOS. Verified with a clean npm ci, which completed the full prepare/build pipeline.

Risk & Scope

  • Main risk or tradeoff: None beyond changing which retained API initializes the mocked Gemini client in this test.
  • Not validated / out of scope: Production behavior and unrelated refactor(core): shrink the content generator interface #9676 follow-up suggestions.
  • Breaking changes / migration notes: None; this is test-only and restores the build after the interface shrink.

Linked Issues

Follow-up to #9676.

中文说明

本 PR 的改动

将遗漏的 Vertex 认证懒构造测试改为调用 embedContent;这是 #9676 其余测试迁移统一采用、且仍保留在 ContentGenerator 中的操作。

为什么需要

#9676ContentGenerator 删除了 countTokens,但 main 上独立加入的一条 Vertex ADC 测试仍保留 generator.countTokens(...)。因此当前 mainnpm ci、build 和 typecheck 阶段都会于 contentGenerator.test.ts:776 报出 TS2339。该集成失败此前也已被该 PR 自身的沙箱验证记录

审查测试计划

验证方法

  1. 在当前 main 上运行 npm run build --workspace packages/core,可看到 Property 'countTokens' does not exist on type 'ContentGenerator'
  2. 在本分支运行 cd packages/core && npx vitest run src/core/contentGenerator.test.ts --maxWorkers=1,确认 27 条测试全部通过。
  3. 运行 npm run typecheck,确认所有 workspace 与 typecheck:integration 均通过。

前后证据

UI 不适用。修改前:core 编译在 contentGenerator.test.ts:776TS2339 中止。修改后:干净 npm ci 中的全仓库 build 完成,目标文件 27/27 通过,全工作区与 integration typecheck 成功完成。

测试平台

OS 状态
🍏 macOS
🪟 Windows N/A
🐧 Linux N/A

环境(可选)

macOS,Node.js 22.22.2。已通过干净 npm ci 验证,它完整执行并通过了 prepare/build 流程。

风险与范围

  • 主要风险或取舍:除测试中改用另一个仍保留的 API 来初始化 Gemini mock 客户端外,无其他风险。
  • 未验证 / 范围外:生产行为及 refactor(core): shrink the content generator interface #9676 的其他后续建议。
  • 破坏性变更 / 迁移说明:无;这是纯测试修复,用于恢复接口收缩后的构建。

关联问题

#9676 的后续修复。

@qwen-code-ci-bot

qwen-code-ci-bot commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Qwen Triage finishedview run. See the stage comments in this thread for the result.

Qwen Triage 已完成 —— 查看运行。结果见本线程中的各阶段评论。

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @yu-xin-c — your diagnosis was right: main really was broken at contentGenerator.test.ts:776 (TS2339, the leftover countTokens call after #9676). But the identical fix landed first: #9888 merged the exact same change at 09:24 UTC today (main commit 6a21c43), about 15 minutes before this PR was opened.

Verified via the API:

  • This PR's diff is byte-for-byte identical to #9888's diff — same file, same hunks, same blobs (a2082a09d3e4e1831f4336).
  • The file blob on this PR's head (4e1831f4336d…) already matches the same file on main — merging this PR would change nothing.

So there is nothing left to review or test here. Requesting changes only because the gate needs a formal state; the right outcome is closing this PR as superseded by #9888. Thanks for catching the broken build and taking the time to fix it — you were only minutes late. 🙏

中文说明

感谢 @yu-xin-c —— 你的判断是对的:main 当时确实因 contentGenerator.test.ts:776TS2339#9676 之后遗留的 countTokens 调用)而构建失败。但相同的修复先一步落地:#9888 已于今天 09:24 UTC 合并了完全一致的改动(main commit 6a21c43),比本 PR 的创建时间早约 15 分钟。

已通过 API 核实:

  • 本 PR 的 diff 与 #9888 逐字节一致——同一文件,同一 hunk,同一 blob(a2082a09d3e4e1831f4336)。
  • 本 PR head 上该文件的 blob(4e1831f4336d…)与 main 上的已完全相同——合并本 PR 不会产生任何变化。

因此这里没有可继续审查或测试的内容。标记 request changes 只是流程需要一个正式状态;正确的处理是关闭本 PR(已被 #9888 取代)。感谢你发现构建损坏并花时间修复——只是晚了几分钟。🙏

Qwen Code · qwen3.8-max

@yu-xin-c

Copy link
Copy Markdown
Contributor Author

Thanks for confirming and for tracing this to #9888. I independently hit the same TS2339 failure while validating #9896 and opened this fix before noticing that #9888 had landed minutes earlier. Closing as superseded by #9888.

@yu-xin-c yu-xin-c closed this Aug 24, 2026
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.

2 participants