Run campaign data check in release verification

This commit is contained in:
2026-07-05 07:13:41 +09:00
parent 2a160bc5c3
commit 6b35c780d8

View File

@@ -1,4 +1,4 @@
import { spawn } from 'node:child_process';
import { spawn, spawnSync } from 'node:child_process';
import { mkdirSync } from 'node:fs';
import { chromium } from 'playwright';
@@ -9,6 +9,7 @@ let serverProcess;
let browser;
try {
runCommand('node', ['scripts/verify-campaign-flow-data.mjs']);
mkdirSync(screenshotDir, { recursive: true });
serverProcess = await ensurePreviewServer(targetUrl);
@@ -465,3 +466,10 @@ function assert(condition, message) {
throw new Error(message);
}
}
function runCommand(command, args) {
const result = spawnSync(command, args, { cwd: process.cwd(), stdio: 'inherit' });
if (result.status !== 0) {
throw new Error(`Command failed: ${command} ${args.join(' ')}`);
}
}