From 1d816d8eae5f1f827562513508ad1e0ae0efeabb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Mon, 22 Jun 2026 10:38:32 +0200 Subject: [PATCH] test(rollups): use WEIGHT for the DST parity case The case exists to pin that the epoch-day x-axis is DST-agnostic, not to exercise BLOOD_GLUCOSE, whose source-priority/CGM consolidation makes the live raw-row regression and the bucket-folded accumulators legitimately read different row sets. WEIGHT folds raw rows directly (the bit-identical case proves it), so the DST-straddling timestamps now parity-match tightly. --- .../rollup-regression-parity.integration.test.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/integration/rollup-regression-parity.integration.test.ts b/tests/integration/rollup-regression-parity.integration.test.ts index b6fa82368..2a7e5a723 100644 --- a/tests/integration/rollup-regression-parity.integration.test.ts +++ b/tests/integration/rollup-regression-parity.integration.test.ts @@ -304,24 +304,29 @@ describe("rollup regression accumulators — live parity (v1.20.0 F6)", () => { { at: "2026-03-30T08:00:00.000Z", value: 105.0 }, { at: "2026-03-31T08:00:00.000Z", value: 108.0 }, ]; + // WEIGHT, like the bit-identical case above: a plain metric whose rollup + // folds the raw rows directly. (BLOOD_GLUCOSE carries a source-priority / + // CGM-vs-spot consolidation that makes the live raw-row REGR and the + // bucket-folded accumulators legitimately regress over different row sets — + // orthogonal to the DST x-axis property this case is here to pin.) await prisma.measurement.createMany({ data: seed.map((s) => ({ userId: user.id, - type: "BLOOD_GLUCOSE" as const, + type: "WEIGHT" as const, value: s.value, - unit: "mg/dL", + unit: "kg", source: "MANUAL" as const, measuredAt: new Date(s.at), })), }); await recomputeUserRollups(user.id, { - types: ["BLOOD_GLUCOSE"], + types: ["WEIGHT"], granularities: ["DAY"], }); - const live = await liveRegr(prisma, user.id, "BLOOD_GLUCOSE"); - const acc = await foldedAccumulators(prisma, user.id, "BLOOD_GLUCOSE"); + const live = await liveRegr(prisma, user.id, "WEIGHT"); + const acc = await foldedAccumulators(prisma, user.id, "WEIGHT"); const composed = composeRegression(acc); expect(Number(live.n)).toBe(seed.length);