DeepVCode
DeepVCode copied to clipboard
[测试/HIGH] integration-tests 目录缺失,test:e2e / test:integration:* 脚本失效
问题
package.json 定义了 E2E / 集成测试脚本,但它们依赖的 integration-tests/ 目录在仓库中不存在。
package.json:
"test:e2e": "npm run test:integration:sandbox:none -- --verbose --keep-output",
"test:integration:sandbox:none": "GEMINI_SANDBOX=false node integration-tests/run-tests.js",
"test:integration:sandbox:docker": "GEMINI_SANDBOX=docker node integration-tests/run-tests.js",
"test:integration:sandbox:podman": "GEMINI_SANDBOX=podman node integration-tests/run-tests.js",
实际检查:
$ ls integration-tests
ls: integration-tests: No such file or directory
$ git ls-files integration-tests | wc -l
0
该目录既不在磁盘上,也未被 git 跟踪,也没有被 .gitignore 忽略——推测是开源 fork 时被剥离,但脚本未同步移除。
影响
npm run test:e2e/npm run test:integration:*直接报「找不到文件」而失败。npm run test:ci经test:scripts仍可跑,但端到端覆盖在当前 checkout 中实际为零。- 对新贡献者有误导:以为有 E2E 测试,实际没有。
建议(任选其一)
- 补回
integration-tests/(含run-tests.js与用例);或 - 暂时移除 / 注释这些脚本,并在 README 注明 E2E 暂不可用;或
- 把它们改成占位脚本并打印「集成测试未随开源版本提供」。
本 issue 来自对
opensource分支的一次代码审计(共 8 条,按严重程度拆分),结论均含文件:行号出处,欢迎指正。
认领并已提交 PR #38(采用建议方案 3):新增 integration-tests/run-tests.js 占位 runner,test:e2e / test:integration:* 现在退出码 0 并打印「E2E 未随开源版本提供」的清晰说明,而非 Cannot find module 崩溃;同时让 eslint integration-tests 有文件可 lint。已实测两条脚本退出码均为 0。