diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3220481..6aba14c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -118,7 +118,7 @@ jobs: test-smoke: name: Smoke Tests runs-on: ubuntu-latest - timeout-minutes: 15 + timeout-minutes: 30 services: postgres: image: postgres:17 diff --git a/packages/core/tests/integration/smoke/site-matrix-smoke.test.ts b/packages/core/tests/integration/smoke/site-matrix-smoke.test.ts index 2f2bf93..6d0ec10 100644 --- a/packages/core/tests/integration/smoke/site-matrix-smoke.test.ts +++ b/packages/core/tests/integration/smoke/site-matrix-smoke.test.ts @@ -180,7 +180,48 @@ async function fetchWithRetry(url: string, retries = 10, delayMs = 1500): Promis throw lastError instanceof Error ? lastError : new Error(`Request failed for ${url}`); } -describe.sequential("Site smoke matrix", () => { +// --------------------------------------------------------------------------- +// Build verification — runs `astro build` for every site to catch adapter +// and bundling errors that dev mode doesn't surface. +// --------------------------------------------------------------------------- + +describe.sequential("Site build verification", () => { + const BUILD_TIMEOUT = 120_000; + + for (const site of SITE_MATRIX) { + if (site.mode === "typecheck") continue; + + it(`${site.name} builds successfully`, { timeout: BUILD_TIMEOUT + 30_000 }, async () => { + await ensureBuilt(); + + try { + await execAsync("pnpm", ["exec", "astro", "build"], { + cwd: site.dir, + timeout: BUILD_TIMEOUT, + env: { + ...process.env, + CI: "true", + }, + }); + } catch (error) { + const stderr = + error instanceof Error && "stderr" in error ? (error as { stderr: string }).stderr : ""; + const stdout = + error instanceof Error && "stdout" in error ? (error as { stdout: string }).stdout : ""; + throw new Error(`${site.name} build failed:\n\n${stderr || stdout}`.slice(0, 5000), { + cause: error, + }); + } + }); + } +}); + +// --------------------------------------------------------------------------- +// Runtime verification — boots each site with `astro dev` and checks that +// admin + frontend respond. +// --------------------------------------------------------------------------- + +describe.sequential("Site runtime verification", () => { for (const site of SITE_MATRIX) { if (site.mode === "typecheck") { it(`${site.name} typechecks`, { timeout: 120_000 }, async () => {