Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/community/StabilityAdmin.interaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { StabilityAdmin, StabilityReport } from './StabilityAdmin'
import { api } from './api'

vi.mock('./api', async original => ({ ...await original<typeof import('./api')>(), 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)
Expand Down
4 changes: 3 additions & 1 deletion src/community/StabilityAdmin.test.ts
Original file line number Diff line number Diff line change
@@ -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 })
Expand Down
11 changes: 11 additions & 0 deletions src/community/stability-releases.fixture.ts
Original file line number Diff line number Diff line change
@@ -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',
},
}