test(integration): expect the worker's own database in the environment check

The environment check pinned the database a worker talks to as the single
shared one. Each worker now runs against its own clone, so the check names
the clone and asserts it is not the migrated template the clones copy.
This commit is contained in:
Marc-André Bombeck committed 2026-10-22 05:48:05 +02:00
1 parent d010ed2301
commit d539eee90b
1 file changed
+5 -1
+5 -1
View File
@@ -1,6 +1,7 @@
import { describe, expect, it } from "vitest";
import { getPrismaClient } from "./setup";
import { TEMPLATE_DATABASE, workerDatabaseName } from "./worker-database";
const TEST_ENCRYPTION_KEY =
"0000000000000000000000000000000000000000000000000000000000000000";
@@ -22,6 +23,9 @@ describe("integration worker environment", () => {
>`
SELECT current_database() AS database_name
`;
expect(rows).toEqual([{ database_name: "healthlog_test" }]);
// Each worker runs against its own clone, never the migrated template
// the clones are copied from.
expect(rows).toEqual([{ database_name: workerDatabaseName() }]);
expect(rows[0].database_name).not.toBe(TEMPLATE_DATABASE);
});
});