Run campaign data check in release verification
This commit is contained in:
@@ -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(' ')}`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user