From 718c06dc987718ebec679855bb565c697af066bb Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Tue, 8 Sep 2026 15:36:10 -0700 Subject: [PATCH] test(standalone): derive the fixture vendor id for every host arch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fixture appended `-arm64` only on Windows, so on a Linux ARM64 host it built `linux-nvidia` — an id the wizard's architecture filter now rejects. Seven release/variant tests failed there while passing on x64 CI. Mirror `variantMatchesHostArch` instead (macOS is unsuffixed ARM64; every other platform needs the suffix on an ARM64 host) and add a guard test so a future divergence fails once, with a message that names the cause. --- src/main/sources/standalone/index.test.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/main/sources/standalone/index.test.ts b/src/main/sources/standalone/index.test.ts index 20776cb4f..d861a1dd3 100644 --- a/src/main/sources/standalone/index.test.ts +++ b/src/main/sources/standalone/index.test.ts @@ -20,19 +20,29 @@ import { resetTemplateCatalogCache } from './templateCatalog' import { CURATED_TEMPLATES, NO_TEMPLATE_VALUE, INDEX_URL } from './curatedTemplates' import { fetchJSON } from '../../lib/fetch' import { getLatestStableTag } from '../../lib/comfyui-releases' -import { PLATFORM_PREFIX } from './envPaths' +import { PLATFORM_PREFIX, variantMatchesHost } from './envPaths' import type { FieldOption } from '../../types/sources' import type { InstallationRecord } from '../../installations' const mockedFetchJSON = vi.mocked(fetchJSON) const mockedGetLatestStableTag = vi.mocked(getLatestStableTag) -// Use the running platform's vendor prefix (and, on Windows, the running -// architecture's suffix) so tests work on win32/darwin/linux CI runners and on -// native ARM64 Windows dev machines alike — the wizard filters by both. -const ARCH_SUFFIX = process.platform === 'win32' && process.arch === 'arm64' ? '-arm64' : '' +// Use the running platform's vendor prefix and architecture suffix so tests +// pass on every runner and dev machine — the wizard filters by both. Mirrors +// `variantMatchesHostArch`: macOS bundles are unsuffixed ARM64, every other +// platform needs `-arm64` on an ARM64 host. +const ARCH_SUFFIX = process.arch === 'arm64' && process.platform !== 'darwin' ? '-arm64' : '' const VENDOR_ID = `${PLATFORM_PREFIX[process.platform] || 'win-'}nvidia${ARCH_SUFFIX}` +// Guard the line above: when the host filter and this id disagree, every +// release/variant assertion below returns an empty list and fails for a +// reason that points nowhere near the cause. +describe('test fixture', () => { + it('derives a vendor id the host architecture filter accepts', () => { + expect(variantMatchesHost(VENDOR_ID)).toBe(true) + }) +}) + // --- Helpers --- type R2Release = {