Skip to content

test: enforce code coverage and public API assertion gates - #8

Merged
cuimmm merged 2 commits into
mainfrom
codex/api-test-coverage-ci
Nov 17, 2026
Merged

cuimmm merged 2 commits into
mainfrom
codex/api-test-coverage-ci

Conversation

@KyleHuangFromHZ

@KyleHuangFromHZ KyleHuangFromHZ commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

建立公开 API、字段和常量到功能场景及测试断言的可追溯清单,并将零缺口检查和代码覆盖率接入 CI。修复禁用滚动策略后 setAutoFit(true) 无法恢复自动适配的问题。

CI / Node 22
├─ test:coverage  行/语句 ≥96%,分支 ≥87%,函数 ≥98%
├─ test:api       1,514 个可调用 API + 464 项字段/常量均有断言场景
│                13 个占位接口独立标记;拒绝过期、跳过或失败的测试证据
└─ build          保存覆盖率及 API 映射报告,保留 14 天

Evidence

  • Before: 缺少覆盖率和 API 场景门禁;false 滚动策略下的自动适配恢复行为缺少回归保护。
    After: 新增覆盖率报告、983 个可追溯 API 场景以及门禁反例测试;auto-fit state follows disabled strategies and resumed data following 回归用例通过。
  • 同步至 main 的 f376431 后,Node 22 全量测试 1,424 通过、2 跳过,类型检查、构建和 npm 包入口检查通过。
  • 行/语句覆盖率 96.51%、分支 87.79%、函数 98.34%;可调用 API 缺口和公开值缺口均为 0。
  • 生成清单位于 docs/api-test-map.md / .json,占位说明和部分实现限制位于 docs/api-test-policy.json。场景映射不代表全部参数组合或浏览器行为均已验收。
  • 修正 CI 环境差异:TypeScript 绝对导入路径归一化为仓库相对路径,新增目录迁移及 Windows 路径回归测试;浏览器在绘制所在任务中读取默认帧缓冲,保留全部像素阈值。Windows 浏览器 CI 已通过;本地浏览器 15 项检查、41 个示例和 13 项交互检查均通过。

Merge Danger

Door: two-way

可通过 revert 回退,无数据迁移。

Blast Radius: CI

新增门禁会拒绝覆盖率不足、缺少字段/常量场景或丢失既有断言的改动;运行时行为变更为坐标轴自动适配恢复修复。

TypeScript import types contained checkout-specific absolute paths, causing Linux CI to disagree with the committed API signatures. Canonicalize repository imports and cover relocation plus Windows paths. Render the browser smoke frame in the same task as pixel readback while retaining the GPU assertions.
@cuimmm
cuimmm merged commit 6d21940 into main Nov 17, 2026
6 checks passed
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