From 2f9dc544000cf1c81c2ba818d544a299792ad897 Mon Sep 17 00:00:00 2001 From: "Molecule AI Dev Engineer A (Kimi)" Date: Sun, 14 Jun 2026 01:26:01 +0000 Subject: [PATCH] test(e2e): make chat-history fixture seeding fail-closed (#2764) canvas/e2e/chat-separation.spec.ts is now wired into the E2E Chat lane and uses deterministic workspace/activity fixtures, but seedChatHistory() would silently return when E2E_DATABASE_URL was missing. That left a false-green path: the Data Flow tests would proceed without seeded history and could only fail if their assertions happened to catch the absence. - seedChatHistory now throws when E2E_DATABASE_URL is unavailable, so the spec fails loudly at fixture-setup time instead of false-greening. - cleanupWorkspace retains its best-effort silent return (cleanup should not fail the test if the DB is already torn down). Fixes #2764 Co-Authored-By: Claude --- canvas/e2e/fixtures/chat-seed.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/canvas/e2e/fixtures/chat-seed.ts b/canvas/e2e/fixtures/chat-seed.ts index 12869a17b..3e966edcf 100644 --- a/canvas/e2e/fixtures/chat-seed.ts +++ b/canvas/e2e/fixtures/chat-seed.ts @@ -187,7 +187,12 @@ export async function seedChatHistory( workspaceId: string, messages: Array<{ role: "user" | "agent"; content: string }>, ): Promise { - if (!process.env.E2E_DATABASE_URL) return; + // Fail-closed: this is a setup helper, not a test. Silently returning when + // the DB is unavailable would make downstream assertions pass vacuously + // (false-green) — the spec must fail if it cannot seed its fixtures. + if (!process.env.E2E_DATABASE_URL) { + throw new Error("E2E_DATABASE_URL must be set for chat-history seeding"); + } const rows = messages .map((msg, i) => { -- 2.52.0