Skip to content

Commit 8e281d8

Browse files
committed
test(engine): the version-banner probes go through a named binary like the other spawns
1 parent b7371c2 commit 8e281d8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎packages/engine/src/utils/ffprobe.remoteIdentity.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ describe.skipIf(!HAS_FFMPEG)("probing a file held at a URL", { timeout: 60_000 }
138138
});
139139

140140
it("records the ffprobe major version beside the facts, when the build reports one", () => {
141-
const banner = spawnSync(getFfprobeBinary(), ["-version"], { encoding: "utf-8" }).stdout;
141+
const binary = getFfprobeBinary();
142+
const banner = spawnSync(binary, ["-version"], { encoding: "utf-8" }).stdout;
142143
const major = Number(/version n?(\d+)/.exec(banner)?.[1]) || undefined;
143144
expect(JSON.parse(factsJson).ffprobeMajor).toBe(major);
144145
});

‎packages/engine/src/utils/ffprobe.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,8 @@ let runtimeFfprobeMajor: Promise<number | undefined> | undefined;
461461
function ffprobeMajor(): Promise<number | undefined> {
462462
runtimeFfprobeMajor ??= new Promise((resolve) => {
463463
let out = "";
464-
const proc = spawn(getFfprobeBinary(), ["-version"], { stdio: ["ignore", "pipe", "ignore"] });
464+
const binary = getFfprobeBinary();
465+
const proc = spawn(binary, ["-version"], { stdio: ["ignore", "pipe", "ignore"] });
465466
proc.stdout.on("data", (chunk) => (out += String(chunk)));
466467
proc.on("error", () => resolve(undefined));
467468
proc.on("close", () => resolve(Number(/version n?(\d+)/.exec(out)?.[1]) || undefined));

0 commit comments

Comments
 (0)