Disable Turbopack in Verification Harness auto-build checks
This commit is contained in:
@@ -6,12 +6,7 @@
|
|||||||
* injected ToolExecutor, so they are fully unit-testable with mocked outputs.
|
* injected ToolExecutor, so they are fully unit-testable with mocked outputs.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {
|
import type { AcceptanceCheck, CheckKind, CheckResult, ExecCtx } from "./types";
|
||||||
AcceptanceCheck,
|
|
||||||
CheckKind,
|
|
||||||
CheckResult,
|
|
||||||
ExecCtx,
|
|
||||||
} from "./types";
|
|
||||||
|
|
||||||
// ── helpers ────────────────────────────────────────────────────────────────
|
// ── helpers ────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
@@ -29,7 +24,11 @@ export function redact(s: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function clip(s: string, n = 400): string {
|
export function clip(s: string, n = 400): string {
|
||||||
const out = redact(String(s ?? "").replace(/\s+/g, " ").trim());
|
const out = redact(
|
||||||
|
String(s ?? "")
|
||||||
|
.replace(/\s+/g, " ")
|
||||||
|
.trim(),
|
||||||
|
);
|
||||||
return out.length > n ? out.slice(0, n) + "…" : out;
|
return out.length > n ? out.slice(0, n) + "…" : out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,11 +104,7 @@ function str(spec: Record<string, unknown>, key: string, dflt = ""): string {
|
|||||||
const v = spec[key];
|
const v = spec[key];
|
||||||
return typeof v === "string" ? v : dflt;
|
return typeof v === "string" ? v : dflt;
|
||||||
}
|
}
|
||||||
function num(
|
function num(spec: Record<string, unknown>, key: string, dflt: number): number {
|
||||||
spec: Record<string, unknown>,
|
|
||||||
key: string,
|
|
||||||
dflt: number,
|
|
||||||
): number {
|
|
||||||
const v = spec[key];
|
const v = spec[key];
|
||||||
return typeof v === "number" ? v : dflt;
|
return typeof v === "number" ? v : dflt;
|
||||||
}
|
}
|
||||||
@@ -137,7 +132,12 @@ const RUNNERS: Record<
|
|||||||
(check: AcceptanceCheck, ctx: ExecCtx) => Promise<CheckResult>
|
(check: AcceptanceCheck, ctx: ExecCtx) => Promise<CheckResult>
|
||||||
> = {
|
> = {
|
||||||
build: (c, ctx) =>
|
build: (c, ctx) =>
|
||||||
runShellExit(c, ctx, str(c.spec, "command", "npm run build"), "build"),
|
runShellExit(
|
||||||
|
c,
|
||||||
|
ctx,
|
||||||
|
str(c.spec, "command", "npx next build --no-turbopack"),
|
||||||
|
"build",
|
||||||
|
),
|
||||||
|
|
||||||
typecheck: (c, ctx) =>
|
typecheck: (c, ctx) =>
|
||||||
runShellExit(
|
runShellExit(
|
||||||
@@ -156,7 +156,7 @@ const RUNNERS: Record<
|
|||||||
server_up: async (c, ctx) => {
|
server_up: async (c, ctx) => {
|
||||||
const raw = await ctx.exec("dev_server_start", {
|
const raw = await ctx.exec("dev_server_start", {
|
||||||
projectId: ctx.projectId,
|
projectId: ctx.projectId,
|
||||||
command: str(c.spec, "command", "npm run dev"),
|
command: str(c.spec, "command", "npx next dev -H 0.0.0.0 --no-turbopack"),
|
||||||
port: num(c.spec, "port", 3000),
|
port: num(c.spec, "port", 3000),
|
||||||
});
|
});
|
||||||
const r = parseToolResult(raw);
|
const r = parseToolResult(raw);
|
||||||
@@ -183,7 +183,10 @@ const RUNNERS: Record<
|
|||||||
const codeStr = (r.stdout || r.raw).trim().match(/\d{3}/)?.[0];
|
const codeStr = (r.stdout || r.raw).trim().match(/\d{3}/)?.[0];
|
||||||
if (codeStr && Number(codeStr) === expected)
|
if (codeStr && Number(codeStr) === expected)
|
||||||
return ok(c, `${url} → ${codeStr}`);
|
return ok(c, `${url} → ${codeStr}`);
|
||||||
return fail(c, `${url} returned ${codeStr ?? "no response"} (expected ${expected})`);
|
return fail(
|
||||||
|
c,
|
||||||
|
`${url} returned ${codeStr ?? "no response"} (expected ${expected})`,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
console_clean: async (c, ctx) => {
|
console_clean: async (c, ctx) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user