test(e2e): migrate to asset-libraries and /upload APIs
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (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 / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 1m34s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 1m50s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 1m49s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m59s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 3m19s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 5m24s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 6m29s
AI Code Review / AI Code Review (pull_request) Successful in 6m36s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 10m56s
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 2s
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 9m51s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 27s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 1m9s

- Replace POST /video-libraries with POST /asset-libraries (kind: 'video')
- Replace POST /assets/sign + PUT upload_url with POST /upload multipart flow
- Fixes 404 errors in setupFreshUser for staging backend
This commit is contained in:
xiaoxia
2026-09-19 01:59:53 +08:00
parent 0d6ce433d0
commit 69f83aa9e6
3 changed files with 14 additions and 20 deletions
+2 -2
View File
@@ -55,9 +55,9 @@ test.describe("Douyin Script Extraction (#1972)", () => {
data: { name: `Smoke Douyin ${suffix}` },
})
const projectId = (await proj.json()).id ?? (await proj.json()).project_id
await request.post(`${apiBase}/video-libraries`, {
await request.post(`${apiBase}/asset-libraries`, {
headers: authHeader,
data: { project_id: projectId, name: "Smoke" },
data: { project_id: projectId, name: "Smoke", kind: "video" },
})
await page.addInitScript((t: string) => {
+10 -16
View File
@@ -61,35 +61,29 @@ async function setupFreshUser(
expect(proj.ok(), `create project: ${await proj.text()}`).toBeTruthy()
const projectId = (await proj.json()).id ?? (await proj.json()).project_id
const lib = await request.post(`${apiBase}/video-libraries`, {
const lib = await request.post(`${apiBase}/asset-libraries`, {
headers: auth,
data: { project_id: projectId, name: "Smoke" },
data: { project_id: projectId, name: "Smoke", kind: "video" },
})
expect(lib.ok(), `create library: ${await lib.text()}`).toBeTruthy()
const libraryId = (await lib.json()).id
const sig = await request.post(`${apiBase}/assets/sign`, {
headers: auth,
data: {
filename: "sample.mp4",
content_type: "video/mp4",
library_id: libraryId,
source: "local",
},
})
expect(sig.ok(), `sign upload: ${await sig.text()}`).toBeTruthy()
const signData = await sig.json()
const assetId = signData.asset_id
const samplePath = path.join(__dirname, "fixtures", "sample.mp4")
await request.put(signData.upload_url || signData.url, {
const sampleBuf = fs.readFileSync(samplePath)
const up = await request.post(`${apiBase}/upload`, {
headers: auth,
multipart: {
project_id: projectId,
library_id: libraryId,
file: {
name: "sample.mp4",
mimeType: "video/mp4",
buffer: fs.readFileSync(samplePath),
buffer: sampleBuf,
},
},
})
expect(up.ok(), `upload sample: ${await up.text()}`).toBeTruthy()
const assetId = (await up.json()).asset_id
await expect
.poll(
async () => {
+2 -2
View File
@@ -48,9 +48,9 @@ test.describe("Core Navigation", () => {
})
if (proj.ok()) {
const projectId = (await proj.json()).id ?? (await proj.json()).project_id
await request.post(`${apiBase}/video-libraries`, {
await request.post(`${apiBase}/asset-libraries`, {
headers: authHeader,
data: { project_id: projectId, name: "Nav Lib" },
data: { project_id: projectId, name: "Nav Lib", kind: "video" },
})
}
})