test(api): 补充P1级API集成测试(分类/摄入/生成视频/模板分类/仪表盘/声音克隆/TTS) #193

Merged
xiaoxia merged 1 commits from feat/add-p1-api-tests into develop 2026-07-09 11:36:51 +08:00
Owner

概述

补充7个P1级API的集成测试,覆盖核心业务流程。

测试文件

测试文件 测试数 覆盖端点
test_classification_api.py 17 POST /classification-jobs, GET /classification-jobs/{id}
test_ingest_api.py 20 POST /ingest-jobs, GET /ingest-jobs/{id}
test_generated_videos_api.py 24 GET/PATCH /generated-videos, /download-url, review
test_template_categories_api.py 14 GET/POST/DELETE /templates/categories
test_dashboard_api.py 12 GET /dashboard/overview
test_voice_clone_api.py 33 CRUD + status + retry for /voice-clones
test_tts_api.py 38 POST/GET/DELETE /tts/jobs, save-to-library, status

总计

158个测试用例全部通过

技术要点

  • 使用 FastAPI TestClient + dependency_overrides 模式
  • mock 外部依赖(OSS、CosyVoice AI服务等)
  • 内存Repository模拟持久化
  • 每个文件独立可运行:pytest tests/integration/test_xxx.py -v
## 概述 补充7个P1级API的集成测试,覆盖核心业务流程。 ## 测试文件 | 测试文件 | 测试数 | 覆盖端点 | |---------|--------|----------| | test_classification_api.py | 17 | POST /classification-jobs, GET /classification-jobs/{id} | | test_ingest_api.py | 20 | POST /ingest-jobs, GET /ingest-jobs/{id} | | test_generated_videos_api.py | 24 | GET/PATCH /generated-videos, /download-url, review | | test_template_categories_api.py | 14 | GET/POST/DELETE /templates/categories | | test_dashboard_api.py | 12 | GET /dashboard/overview | | test_voice_clone_api.py | 33 | CRUD + status + retry for /voice-clones | | test_tts_api.py | 38 | POST/GET/DELETE /tts/jobs, save-to-library, status | ## 总计 **158个测试用例全部通过** ## 技术要点 - 使用 FastAPI TestClient + dependency_overrides 模式 - mock 外部依赖(OSS、CosyVoice AI服务等) - 内存Repository模拟持久化 - 每个文件独立可运行:`pytest tests/integration/test_xxx.py -v`
xiaoxia added 1 commit 2026-07-09 11:35:58 +08:00
test(api): 补充P1级API集成测试(分类/摄入/生成视频/模板分类/仪表盘/声音克隆/TTS)
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 1h17m29s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 1h17m38s
f195476ea2
xiaoxia merged commit 3adce8c1f1 into develop 2026-07-09 11:36:51 +08:00
Sign in to join this conversation.