fix: resolve smoke test failures -- CLI JSON output, port collision, stale DBs
This commit is contained in:
@@ -14,7 +14,7 @@ import { describe, it, expect, beforeAll, afterAll } from "vitest";
|
||||
import type { TestServerContext } from "../server.js";
|
||||
import { assertNodeVersion, createTestServer } from "../server.js";
|
||||
|
||||
const PORT = 4398;
|
||||
const PORT = 4396;
|
||||
const TIMEOUT = 60_000;
|
||||
|
||||
/** Helper: raw fetch with auth headers */
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { execFile, spawn } from "node:child_process";
|
||||
import { resolve } from "node:path";
|
||||
import { rmSync } from "node:fs";
|
||||
import { join, resolve } from "node:path";
|
||||
import { promisify } from "node:util";
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
@@ -203,6 +204,12 @@ describe.sequential("Site smoke matrix", () => {
|
||||
async () => {
|
||||
await ensureBuilt();
|
||||
|
||||
// Remove stale database files so each run starts fresh.
|
||||
// SQLite demos use data.db; WAL/SHM sidecars may also exist.
|
||||
for (const file of ["data.db", "data.db-wal", "data.db-shm"]) {
|
||||
rmSync(join(site.dir, file), { force: true });
|
||||
}
|
||||
|
||||
const baseUrl = `http://localhost:${site.port}`;
|
||||
const serverProcess = spawn("pnpm", ["exec", "astro", "dev", "--port", String(site.port)], {
|
||||
cwd: site.dir,
|
||||
|
||||
Reference in New Issue
Block a user