From aeaf9463ea29b667d1d1995461b82d4ae4f6fe6f Mon Sep 17 00:00:00 2001 From: Monster-GM <82452083+Monster-GM@users.noreply.github.com> Date: Sat, 14 Nov 2026 18:55:57 +0000 Subject: [PATCH] test(producer): make path contracts portable on Windows (#5032) --- .../producer/src/services/hyperframeRuntimeLoader.test.ts | 4 ++-- .../producer/src/services/render/segmentManifest.test.ts | 2 +- packages/producer/src/utils/ffprobeArgvContract.test.ts | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/producer/src/services/hyperframeRuntimeLoader.test.ts b/packages/producer/src/services/hyperframeRuntimeLoader.test.ts index a34654ef7a..f4915e42ab 100644 --- a/packages/producer/src/services/hyperframeRuntimeLoader.test.ts +++ b/packages/producer/src/services/hyperframeRuntimeLoader.test.ts @@ -1,5 +1,5 @@ import { describe, it, expect, beforeEach, afterEach } from "vitest"; -import { dirname, resolve } from "node:path"; +import { dirname, join, resolve } from "node:path"; import { fileURLToPath } from "node:url"; import { existsSync } from "node:fs"; @@ -33,7 +33,7 @@ describe("resolveHyperframeManifestPath", () => { // dist/index.js. In source, SIBLING_MANIFEST_PATH is next to this file. // This verifies the path construction is correct. expect(SIBLING_PATH).toBe(resolve(THIS_DIR, "hyperframe.manifest.json")); - expect(SIBLING_PATH).toContain("producer/src/services/hyperframe.manifest.json"); + expect(SIBLING_PATH).toContain(join("producer", "src", "services", "hyperframe.manifest.json")); }); it("prefers sibling path when it exists, otherwise picks the first existing candidate", async () => { diff --git a/packages/producer/src/services/render/segmentManifest.test.ts b/packages/producer/src/services/render/segmentManifest.test.ts index 81a25af0fa..a1dae608d0 100644 --- a/packages/producer/src/services/render/segmentManifest.test.ts +++ b/packages/producer/src/services/render/segmentManifest.test.ts @@ -135,7 +135,7 @@ describe("manifest io", () => { it("segmentDirFor nests under renders/.hf-segments", () => { dir = mkdtempSync(join(tmpdir(), "hf-seg-")); - expect(segmentDirFor("/p/renders", "abc")).toBe("/p/renders/.hf-segments/abc"); + expect(segmentDirFor("/p/renders", "abc")).toBe(join("/p/renders", ".hf-segments", "abc")); }); }); diff --git a/packages/producer/src/utils/ffprobeArgvContract.test.ts b/packages/producer/src/utils/ffprobeArgvContract.test.ts index a388c9dffb..d8aaf16aa3 100644 --- a/packages/producer/src/utils/ffprobeArgvContract.test.ts +++ b/packages/producer/src/utils/ffprobeArgvContract.test.ts @@ -158,16 +158,17 @@ function discoverCallers(): { found: string[]; unclassified: string[]; shell: st const shell: string[] = []; const classify = (abs: string): void => { const src = readFileSync(abs, "utf8"); + const relPath = relative(REPO_ROOT, abs).replaceAll("\\", "/"); if (SHELL_EXT.test(abs) && SHELL_PROBE_CALL.test(src)) { - shell.push(relative(REPO_ROOT, abs)); + shell.push(relPath); } // Discovery is ARGV-shaped, not call-shaped. Matching on spawn/execFile // misses a dependency-injected runner — `runner("ffprobe", [...])` in // studio-server's mediaValidation.ts is exactly that, and a call-shaped // predicate skipped it silently. Anything that BUILDS a probe argv is a // caller, however it is invoked. - if (argvTails(src).length > 0) found.push(relative(REPO_ROOT, abs)); - else if (mentionsProbe(src)) unclassified.push(relative(REPO_ROOT, abs)); + if (argvTails(src).length > 0) found.push(relPath); + else if (mentionsProbe(src)) unclassified.push(relPath); }; const walk = (dir: string): void => { for (const entry of readdirSync(dir)) {