diff --git a/script/package-layout-exclusion.test.ts b/script/package-layout-exclusion.test.ts index 1fb0e37d3..033b7ee56 100644 --- a/script/package-layout-exclusion.test.ts +++ b/script/package-layout-exclusion.test.ts @@ -1,6 +1,6 @@ /// -import { afterAll, beforeAll, describe, expect, test } from "bun:test" +import { afterAll, beforeAll, describe, expect, setDefaultTimeout, test } from "bun:test" import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs" import { dirname, join, relative, sep } from "node:path" import { fileURLToPath } from "node:url" @@ -25,13 +25,16 @@ const fakeInternalArtifactCleanupPaths = [ ...fakeInternalSkillArtifactRootPaths, ...fakeInternalCommandArtifactPaths, ] as const +const packageLayoutTestTimeoutMs = 60_000 + +setDefaultTimeout(packageLayoutTestTimeoutMs) let originalPackageJsonText: string | null = null let packageJsonWasTemporarilyModified = false class PackDryRunError extends Error { constructor(readonly exitCode: number, readonly stderr: string) { - super(`bun pm pack --dry-run failed with exit code ${exitCode}: ${stderr}`) + super(`bun pm pack --dry-run --ignore-scripts failed with exit code ${exitCode}: ${stderr}`) this.name = "PackDryRunError" } } @@ -90,7 +93,7 @@ function parsePackedPaths(output: string): Set { async function packDryRunPaths(): Promise> { const packProcess = Bun.spawn({ - cmd: ["bun", "pm", "pack", "--dry-run"], + cmd: ["bun", "pm", "pack", "--dry-run", "--ignore-scripts"], cwd: repositoryRoot, stdout: "pipe", stderr: "pipe", diff --git a/script/package-layout.test.ts b/script/package-layout.test.ts index a4f3c18fd..5f7c759f3 100644 --- a/script/package-layout.test.ts +++ b/script/package-layout.test.ts @@ -1,4 +1,4 @@ -import { describe, expect, test } from "bun:test" +import { describe, expect, setDefaultTimeout, test } from "bun:test" import { existsSync, readdirSync } from "node:fs" import { join, relative, sep } from "node:path" import { fileURLToPath } from "node:url" @@ -6,10 +6,13 @@ import { fileURLToPath } from "node:url" const repositoryRoot = fileURLToPath(new URL("..", import.meta.url)) const commandRoots = [".opencode/command", ".agents/command"] as const const skillRoots = [".opencode/skills", ".agents/skills"] as const +const packageLayoutTestTimeoutMs = 60_000 + +setDefaultTimeout(packageLayoutTestTimeoutMs) class PackDryRunError extends Error { constructor(readonly exitCode: number, readonly stderr: string) { - super(`bun pm pack --dry-run failed with exit code ${exitCode}: ${stderr}`) + super(`bun pm pack --dry-run --ignore-scripts failed with exit code ${exitCode}: ${stderr}`) this.name = "PackDryRunError" } } @@ -98,7 +101,7 @@ function parsePackedPaths(output: string): Set { async function packDryRunPaths(): Promise> { const packProcess = Bun.spawn({ - cmd: ["bun", "pm", "pack", "--dry-run"], + cmd: ["bun", "pm", "pack", "--dry-run", "--ignore-scripts"], cwd: repositoryRoot, stdout: "pipe", stderr: "pipe",