feat: enhance OpenAI response rendering to include reasoning and improve tool call detection from thinking channel, and refactor testing scripts for unified unit test execution.

This commit is contained in:
CJACK
2026-02-20 03:30:39 +08:00
parent 2781951ce7
commit dec9d03fc5
13 changed files with 133 additions and 27 deletions

View File

@@ -8,8 +8,10 @@ DS2API 提供两个层级的测试:
| 层级 | 命令 | 说明 |
| --- | --- | --- |
| 单元测试 | `go test ./...` | 不需要真实账号 |
| 端到端测试 | `./scripts/testsuite/run-live.sh` | 使用真实账号执行全链路测试 |
| 单元测试Go | `./tests/scripts/run-unit-go.sh` | 不需要真实账号 |
| 单元测试Node | `./tests/scripts/run-unit-node.sh` | 不需要真实账号 |
| 单元测试(全部) | `./tests/scripts/run-unit-all.sh` | 不需要真实账号 |
| 端到端测试 | `./tests/scripts/run-live.sh` | 使用真实账号执行全链路测试 |
端到端测试集会录制完整的请求/响应日志,用于故障排查。
@@ -20,17 +22,19 @@ DS2API 提供两个层级的测试:
### 单元测试 | Unit Tests
```bash
go test ./...
./tests/scripts/run-unit-all.sh
```
```bash
node --test api/helpers/stream-tool-sieve.test.js api/chat-stream.test.js api/compat/js_compat_test.js
# 或按语言拆分执行
./tests/scripts/run-unit-go.sh
./tests/scripts/run-unit-node.sh
```
### 端到端测试 | End-to-End Tests
```bash
./scripts/testsuite/run-live.sh
./tests/scripts/run-live.sh
```
**默认行为**
@@ -179,7 +183,7 @@ go run ./cmd/ds2api-tests \
```bash
# 确保 config.json 存在且包含有效测试账号
./scripts/testsuite/run-live.sh
./tests/scripts/run-live.sh
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "Tests failed! Check artifacts for details."