PEP-22: PEPPA_TEST_DB — separate test database for parallel runs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Асель 2026-11-13 13:57:16 +05:00
parent 2048d91586
commit dc2aea8d35

View File

@ -11,7 +11,8 @@ import type { Scenario, MockLogEntry } from "../src/scenario.ts";
const ROOT = resolve(fileURLToPath(import.meta.url), "../../../..");
const TMP = mkdtempSync(join(tmpdir(), "peppa-cjm-"));
const TEST_DB = "peppa_test";
// PEPPA_TEST_DB lets parallel sessions (one per worktree) run the suite without sharing a database.
const TEST_DB = process.env.PEPPA_TEST_DB ?? "peppa_test";
Object.assign(process.env, {
DATABASE_URL: `postgres://peppa:peppa@127.0.0.1:5433/${TEST_DB}`,