Skip to content

Commit 800e8c6

Browse files
committed
test(webapp): give the NEW store its production schema variant
Production builds the NEW run-ops store with schemaVariant "dedicated", but both hetero routing tests omitted it, so the store defaulted to "legacy". The two variants take different read paths: findRun routes through the dedicated relation-stripping adapter only when the variant is set, so the tests were exercising the legacy path for a store that is dedicated in production. Verified the branch is now reached by making the dedicated arm throw, which failed 3 of the 5 tests.
1 parent 0440909 commit 800e8c6

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

apps/webapp/test/performTaskRunAlertsStoreRouting.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ vi.setConfig({ testTimeout: 60_000 });
3434
// routed read, so each store uses its OWN prisma.
3535

3636
function buildRoutingStore(prisma17: PrismaClient, prisma14: PrismaClient) {
37-
const newStore = new PostgresRunStore({ prisma: prisma17, readOnlyPrisma: prisma17 });
37+
const newStore = new PostgresRunStore({
38+
prisma: prisma17,
39+
readOnlyPrisma: prisma17,
40+
schemaVariant: "dedicated",
41+
});
3842
const legacyStore = new PostgresRunStore({ prisma: prisma14, readOnlyPrisma: prisma14 });
3943
return new RoutingRunStore({ new: newStore, legacy: legacyStore });
4044
}

apps/webapp/test/updateMetadataStoreRoutingHetero.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ vi.setConfig({ testTimeout: 60_000 });
2323
// to NEW, a 25-char cuid to LEGACY.
2424

2525
function buildRoutingStore(prisma17: PrismaClient, prisma14: PrismaClient) {
26-
const newStore = new PostgresRunStore({ prisma: prisma17, readOnlyPrisma: prisma17 });
26+
const newStore = new PostgresRunStore({
27+
prisma: prisma17,
28+
readOnlyPrisma: prisma17,
29+
schemaVariant: "dedicated",
30+
});
2731
const legacyStore = new PostgresRunStore({ prisma: prisma14, readOnlyPrisma: prisma14 });
2832
return new RoutingRunStore({ new: newStore, legacy: legacyStore });
2933
}

0 commit comments

Comments
 (0)