Skip to content

Resolve five CodeQL warnings in test fixtures - #2

Merged
empty610 merged 9 commits into
mainfrom
preview/0.4.1
Oct 27, 2026
Merged

empty610 merged 9 commits into
mainfrom
preview/0.4.1

Conversation

@empty610

@empty610 empty610 commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

修正此前 CodeQL 在测试代码中的五条告警,保留现有测试行为与覆盖:

  • 动画测试不再用正则过滤 HTML;通过 CDP 把 HTML 作为数据传给惰性 DOMParser,移除全部 script 节点后再导入页面,同时断言大写 SCRIPT 测试标记未执行。
  • 退出测试与挂件请求追踪改用固定 fixture 文件;临时路径通过参数或环境变量传递,不再拼接为可执行 JavaScript。
  • 同步改写退出测试中同类 launcher fixture,保持原有进程身份路径与模拟传输顺序。

按用户要求,server/local-tls.cjs 及 TLS 文件竞争告警不变。版本继续为 0.4.1-preview,README 保留用户内容。

验证:本地语法、公开源码检查及新增 fixture 的语法检查通过;完整 npm test 为 258 项通过、0 失败、0 跳过。测试仅使用独立临时目录与模拟/演示通道;保持 Electron sandbox、contextIsolation 和 nodeIntegration 设置。只读独立代码复核未发现具体回归。提交后重新运行 Windows CI 和 CodeQL 确认告警状态。

重新扫描后对请求追踪做了进一步收敛:只写入固定路由分类,不保存原始请求 URL 或查询参数,避免引入 network-data-written-to-file 告警。相关两种挂件测试再次通过,并增加健康路由确实被记录的断言。

最终远端验证:提交 8628d41 的 CodeQL 所有语言分析通过,汇总为 No new alerts / 0 annotations;两次必需 verify 均通过,包含完整测试、构建与产物校验。CodeQL 自动将中途的两条请求追踪评审标为已解决。

Comment thread tests/fixtures/widget-trace.mjs Fixed
Comment thread tests/fixtures/widget-trace.mjs Fixed
@empty610
empty610 merged commit 03b0b63 into main Oct 27, 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