fix(test): 统一test_lipsync_tts持久化测试upload_url参数与key一致,消除flaky
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 27s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 26s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 28s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 49s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 1m0s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m42s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 2m40s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 3m34s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 4m3s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 4m8s
AI Code Review / AI Code Review (pull_request) Successful in 6m19s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 8m28s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 9m29s
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Failing after 4s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 7m4s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 85h6m25s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 85h15m33s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 85h15m51s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 85h15m39s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 85h15m27s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 85h6m2s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 85h15m21s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 85h15m21s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 85h15m35s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 85h15m10s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 85h5m59s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 85h5m59s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 85h6m2s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 85h15m11s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 85h15m27s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 85h50m39s

This commit is contained in:
xiaoxia
2026-09-13 02:05:30 +08:00
parent ce6c831cf3
commit 688b35efa8
+4 -10
View File
@@ -448,7 +448,7 @@ class TestPersistOutputVideoTask:
job = self._make_persist_job(output_video_url="https://temp.mk/x.mp4")
session, fake_client, storage, patches = self._persist_patches(
job=job, video_bytes=b"VIDEODATA", upload_url="https://oss.example.com/lipsync-outputs/u1/j1.mp4"
job=job, video_bytes=b"VIDEODATA", upload_url="https://oss.example.com/lipsync-outputs/user-1/job-1.mp4"
)
entered = [p.__enter__() for p in patches]
try:
@@ -459,17 +459,11 @@ class TestPersistOutputVideoTask:
fake_client.get.assert_called_once_with("https://temp.mk/x.mp4")
storage.upload_file.assert_called_once()
# 上传的 key 必须是 lipsync-outputs/{user_id}/{job_id}.mp4
key_arg = (
storage.upload_file.call_args.args[1]
if storage.upload_file.call_args.args
else storage.upload_file.call_args.kwargs.get("key")
)
# upload_file(data, key, content_type=...)
call_args = storage.upload_file.call_args.args
# 上传的 key 必须是 lipsync-outputs/{user_id}/{job_id}.mp4
assert call_args[1] == "lipsync-outputs/user-1/job-1.mp4"
# output_video_url 被替换为签名后的永久 URL
assert job.output_video_url == "https://oss.example.com/lipsync-outputs/u1/j1.mp4?signed"
# upload_file 返回永久 URL,再被 _sign_media_url 追加 ?signed
assert job.output_video_url == "https://oss.example.com/lipsync-outputs/user-1/job-1.mp4?signed"
assert job.updated_at is not None
session.commit.assert_called_once()
session.close.assert_called_once()