test: add local chat completions smoke test#388
Closed
SsuJojo wants to merge 2 commits intoicebear0828:masterfrom
Closed
test: add local chat completions smoke test#388SsuJojo wants to merge 2 commits intoicebear0828:masterfrom
SsuJojo wants to merge 2 commits intoicebear0828:masterfrom
Conversation
icebear0828
requested changes
Apr 17, 2026
Owner
icebear0828
left a comment
There was a problem hiding this comment.
非常感谢补充这个实用的冒烟测试脚本!整体出发点很好。
不过目前的实现有一个小问题会导致流水线阻塞:通过修改根目录的 vitest.config.ts 并加入 include 列表,这意味着 CI 自动执行默认的 npm run test 时也会被强行拉起这个测试。因为 CI 默认是裸机环境,在既没有环境变量注入也没有 mock 预制账户的情况下,这些写死的 gpt-5.4 测试会全部因为未能命中预置规则报 404 Not Found 而导致整个 CI 跑挂。
为了保持它作为一个按需、独立的 local 测试脚本,建议使用和仓库里 test:real 等命令一样的隔离规范:
- 请撤销对根目录
vitest.config.ts的所有修改。 - 参考项目原有的做法,在
tests/local-chat目录下新建一个专门的配置文件vitest.config.ts。 - 然后将
package.json中的脚本声明显式指向该配置:
"test:local-chat": "vitest run --config tests/local-chat/vitest.config.ts"
这样就能完美把它剥离出默认的单测 CI 流水线,并保证开发者手工调用的有效性。期待你的修正!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/v1/chat/completionstest:local-chatscript inpackage.jsontests/local-chatin the Vitest file patternsTest plan
npm run test:local-chat