From bc6fa3d517b356827f5fb0ee3a4bcc4b28042cd0 Mon Sep 17 00:00:00 2001 From: suyx Date: Tue, 4 Aug 2026 19:07:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(WP6):=20=E7=A8=B3=E5=AE=9A=E6=95=B4?= =?UTF-8?q?=E5=90=88=E9=97=A8=E7=A6=81=E7=9A=84=E8=B5=84=E6=BA=90=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E4=B8=8E=E6=B5=8B=E8=AF=95=E8=B6=85=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/run-wp6-04-validation.mjs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/run-wp6-04-validation.mjs b/scripts/run-wp6-04-validation.mjs index 38e7579..c70cc5d 100644 --- a/scripts/run-wp6-04-validation.mjs +++ b/scripts/run-wp6-04-validation.mjs @@ -1,7 +1,8 @@ import { createHash } from "node:crypto"; import { spawnSync } from "node:child_process"; import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs"; -import { resolve } from "node:path"; +import { homedir } from "node:os"; +import { join, resolve } from "node:path"; const phaseIndex = process.argv.indexOf("--phase"); const phase = phaseIndex >= 0 ? process.argv[phaseIndex + 1] : "green"; @@ -10,6 +11,7 @@ if (!new Set(["red", "green"]).has(phase)) throw new Error(`Unsupported phase: $ const runId = process.env.DADA_TDD_RUN_ID ?? `wp6-04-${phase}-${new Date().toISOString().replace(/[^0-9]/g, "")}`; const runDirectory = resolve("artifacts", "tdd", runId); const caseDirectory = resolve(runDirectory, "cases", "TDD-WP6-AUD-001-sensitive-operations"); +const replicationRoot = resolve(process.env.DADA_REPLICATION_ASSET_ROOT ?? join(homedir(), "Desktop", "sticker_web_replication_assets")); if (existsSync(runDirectory)) throw new Error(`Evidence run already exists: ${runId}`); mkdirSync(caseDirectory, { recursive: true }); @@ -17,6 +19,9 @@ const environment = { ...process.env, DADA_EVIDENCE_DIR_WP6_AUD: caseDirectory, DADA_PLAYWRIGHT_OUTPUT_DIR: resolve(runDirectory, "playwright-output"), + DADA_STATIC_STICKER_ROOT: process.env.DADA_STATIC_STICKER_ROOT ?? join(replicationRoot, "sticker_normal"), + DADA_DYNAMIC_ASSET_ROOT: process.env.DADA_DYNAMIC_ASSET_ROOT ?? join(replicationRoot, "sticker_interactive", "单模板归档", "templates"), + DADA_TEXT_ASSET_ROOT: process.env.DADA_TEXT_ASSET_ROOT ?? join(replicationRoot, "sticker_text"), }; const commands = phase === "red" ? [ @@ -25,8 +30,8 @@ const commands = phase === "red" ["e2e-red", ".\\node_modules\\.bin\\playwright.CMD test tests/e2e/wp6-04-audit.spec.ts --config playwright.config.ts"], ] : [ - ["integration", "pnpm.cmd test:integration"], - ["api", "pnpm.cmd test:api"], + ["integration", "pnpm.cmd exec vitest run tests/integration --testTimeout=20000"], + ["api", "pnpm.cmd check:openapi && pnpm.cmd exec vitest run tests/api --testTimeout=20000"], ["worker", "pnpm.cmd test:worker"], ["e2e", "pnpm.cmd test:e2e"], ["tdd-trace", "pnpm.cmd validate:tdd-trace"],