Skip to content

Api test:improve API test infrastructure with dual-mode CI#950

Merged
qin-ctx merged 1 commit intovolcengine:mainfrom
kaisongli:api_test
Mar 26, 2026
Merged

Api test:improve API test infrastructure with dual-mode CI#950
qin-ctx merged 1 commit intovolcengine:mainfrom
kaisongli:api_test

Conversation

@kaisongli
Copy link
Copy Markdown
Collaborator

@kaisongli kaisongli commented Mar 25, 2026

feat: improve API test infrastructure with dual-mode CI

变更概述

本次 PR 对 API 测试基础设施进行了全面升级,主要包含以下改进:

1. 场景化测试用例优化

  • 优化了 scenarios/ 目录下 9 个测试用例
  • 增加了中文测试数据和详细步骤说明
  • 使测试流程更贴近实际使用场景

2. CI/CD 流水线优化

  • 使用 uv sync --frozen 替代 pip,解决 litellm 依赖安装问题
  • 实现了双模式流水线:
    • 有 secrets 模式(主分支/内部 PR):运行完整测试
    • 无 secrets 模式(外部 PR):使用 dummy 配置,运行基础测试
  • 解决了外部 PR 无法访问上游仓库 secrets 的问题

3. 代码格式修复

  • 修复了所有 ruff lint 问题
  • 保持 pyproject.toml 配置不变
  • 修复了 tools/ 目录下的 E402 和格式问题

4. 测试用例修复

  • 修复了 test_add_resource.py:使用本地临时文件而非已索引的 Viking URI
  • 修复了 API 客户端 add_resource:将 target 参数改为 to,与服务器 API 保持一致
  • 修复了 test_grep.py:交换了 uripattern 参数顺序
  • 修复了 local-test.sh:添加配置文件创建和合理的测试范围
  • 添加了详细的场景化测试步骤和验证

测试范围

始终运行的基础测试

  • admin(账户、用户、角色、密钥管理)
  • filesystem(文件系统操作)
  • health_check(服务健康检查)
  • resources(部分)
  • sessions(会话管理)
  • skills(技能管理)
  • system(系统管理)

有 secrets 时运行的完整测试

  • retrieval(搜索和检索)
  • resources(完整测试)

验证结果

  • 在 fork 仓库中完整测试通过
  • 外部 PR 模式下基础测试通过
  • 所有代码格式检查通过

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 25, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

@qin-ctx qin-ctx self-assigned this Mar 25, 2026
Copy link
Copy Markdown
Collaborator

@qin-ctx qin-ctx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review focuses on correctness and CI reliability. I found three blocking issues in the new test suite/workflow and two follow-up suggestions around API contract drift and PR hygiene.

@kaisongli kaisongli force-pushed the api_test branch 3 times, most recently from 2f46d7a to bf6f580 Compare March 25, 2026 07:28
@kaisongli kaisongli changed the title Api test Api test:improve API test infrastructure with dual-mode CI Mar 25, 2026
@kaisongli kaisongli force-pushed the api_test branch 11 times, most recently from 1ceeadb to 1151a1b Compare March 25, 2026 09:49
- 使用 uv 管理依赖和虚拟环境
- 实现双模式测试策略(有 secrets 运行完整测试,无 secrets 跳过 VLM/Embedding 测试)
- 添加 GitHub Actions CI 配置
- 添加本地化脚本 local-test.sh
- 优化测试用例,添加场景化断言和中文测试数据
- 修复 API 客户端字段名与服务端契约不一致问题
- 确保在干净环境中可重复运行
@qin-ctx qin-ctx merged commit f32af08 into volcengine:main Mar 26, 2026
7 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants