From 3b339bc710fa37587a770119ef98a0fb54fc5280 Mon Sep 17 00:00:00 2001 From: repeat98 Date: Mon, 30 Nov 2026 16:58:23 +0100 Subject: [PATCH] Fix: the Stability tests chart a fixed release list StabilityAdmin.test.ts and StabilityAdmin.interaction.test.ts read the committed base-releases.json, which octatrack-base.mjs --write dates with the build day for every base main lacks. A draft base built inside the tests' fixed November window (0.8.6 on #2473, 30 November) added a marker and failed both. They now mock the file with the list as it stood on main, in stability-releases.fixture.ts. Co-Authored-By: Claude Opus 5.5 --- src/community/StabilityAdmin.interaction.test.ts | 1 + src/community/StabilityAdmin.test.ts | 4 +++- src/community/stability-releases.fixture.ts | 11 +++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/community/stability-releases.fixture.ts diff --git a/src/community/StabilityAdmin.interaction.test.ts b/src/community/StabilityAdmin.interaction.test.ts index 22534cf1c5..c6d47f6b8b 100644 --- a/src/community/StabilityAdmin.interaction.test.ts +++ b/src/community/StabilityAdmin.interaction.test.ts @@ -7,6 +7,7 @@ import { StabilityAdmin, StabilityReport } from './StabilityAdmin' import { api } from './api' vi.mock('./api', async original => ({ ...await original(), api: vi.fn() })) +vi.mock('../../sdk/machines/octatrack/base-releases.json', async () => ({ default: (await import('./stability-releases.fixture')).STABILITY_TEST_RELEASES })) const bucket = (start: string, index: number): StabilityDay => ({ start, closed: index < STABILITY_DAYS - 1, shown: true, hours: 10, problems: { freeze: index, crash: 0, stall: 0 }, warnings: { hot: 1, shed: 0 }, cpuMean: 500, cpuP95: 600, dspMean: 550, dspP95: 700, dropoutShare: 0 }) const day = (index: number) => new Date(Date.parse('2026-11-01T00:00:00Z') + index * 86400000).toISOString().slice(0, 10) diff --git a/src/community/StabilityAdmin.test.ts b/src/community/StabilityAdmin.test.ts index 519120f0d6..3b751e62bc 100644 --- a/src/community/StabilityAdmin.test.ts +++ b/src/community/StabilityAdmin.test.ts @@ -1,10 +1,12 @@ import { createElement } from 'react' import { renderToStaticMarkup } from 'react-dom/server' -import { describe, expect, it } from 'vitest' +import { describe, expect, it, vi } from 'vitest' import { STABILITY_DAYS, STABILITY_MIN_SHARERS, type PublicStability, type StabilityDay } from './stability-contract' import { StabilityReport } from './StabilityAdmin' import { columnPath } from '../components/chart-columns' +vi.mock('../../sdk/machines/octatrack/base-releases.json', async () => ({ default: (await import('./stability-releases.fixture')).STABILITY_TEST_RELEASES })) + const NOW = Date.parse('2026-11-30T13:32:00.000Z') const day = (index: number) => new Date(Date.parse('2026-11-01T00:00:00Z') + index * 86400000).toISOString().slice(0, 10) const hidden = (start: string, closed = true): StabilityDay => ({ start, closed, shown: false, hours: null, problems: null, warnings: null, cpuMean: null, cpuP95: null, dspMean: null, dspP95: null, dropoutShare: null }) diff --git a/src/community/stability-releases.fixture.ts b/src/community/stability-releases.fixture.ts new file mode 100644 index 0000000000..1d91922beb --- /dev/null +++ b/src/community/stability-releases.fixture.ts @@ -0,0 +1,11 @@ +// The base release days the Stability tests chart (sdk/machines/octatrack/base-releases.json as of 30 November 2026): the +// real file gains a day with every base build (octatrack-base.mjs --write), so a draft base built inside the tests' fixed +// November window must not change what they expect. +export const STABILITY_TEST_RELEASES = { + schema: 1, + releases: { + '0.7.7': '2026-11-17', '0.7.8': '2026-11-17', '0.7.9': '2026-11-18', '0.7.10': '2026-11-18', '0.7.11': '2026-11-20', + '0.7.12': '2026-11-20', '0.7.13': '2026-11-21', '0.8': '2026-11-22', '0.8.1': '2026-11-23', '0.8.2': '2026-11-23', + '0.8.3': '2026-11-26', '0.8.4': '2026-11-27', '0.8.5': '2026-11-30', + }, +}