mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-15 13:58:20 +00:00
fix(producer): pass variables to duration probe
This commit is contained in:
@@ -6,6 +6,7 @@ import { hasAutoStartVideos, hasScriptedAudioVolumeAutomation } from "./probeSta
|
||||
// the correct forceScreenshot value (regression for #1236 — probe was launched
|
||||
// in beginframe mode even when lowMemoryMode demanded screenshot capture).
|
||||
const capturedCfgs: unknown[] = [];
|
||||
const capturedOptions: unknown[] = [];
|
||||
|
||||
const mockPage = {
|
||||
evaluate: async () => ({
|
||||
@@ -39,12 +40,13 @@ mock.module("@hyperframes/engine", () => ({
|
||||
createCaptureSession: async (
|
||||
_url: string,
|
||||
_dir: string,
|
||||
_opts: unknown,
|
||||
opts: unknown,
|
||||
_nullArg: unknown,
|
||||
cfg: unknown,
|
||||
) => {
|
||||
createSessionCallCount++;
|
||||
capturedCfgs.push(cfg);
|
||||
capturedOptions.push(opts);
|
||||
if (createSessionError && createSessionCallCount <= createSessionFailUntilAttempt) {
|
||||
throw createSessionError;
|
||||
}
|
||||
@@ -279,6 +281,21 @@ describe("runProbeStage — forceScreenshot threading", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("runProbeStage — render variable threading", () => {
|
||||
it("passes render variables to the duration-discovery capture session", async () => {
|
||||
capturedOptions.length = 0;
|
||||
const { runProbeStage } = await import("./probeStage.js");
|
||||
const input = makeProbeInput({ stageForceScreenshot: false });
|
||||
input.job.config.variables = { short: true, sceneCount: 2 };
|
||||
|
||||
await runProbeStage(input);
|
||||
|
||||
expect(capturedOptions[0]).toMatchObject({
|
||||
variables: { short: true, sceneCount: 2 },
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("runProbeStage — transient browser error retry (#1687)", () => {
|
||||
it("retries once on a transient 'Navigating frame was detached' error and succeeds", async () => {
|
||||
resetRetryMocks();
|
||||
|
||||
@@ -199,6 +199,7 @@ export async function runProbeStage(input: ProbeStageInput): Promise<ProbeStageR
|
||||
fps: job.config.fps,
|
||||
format: needsAlpha ? "png" : "jpeg",
|
||||
quality: needsAlpha ? undefined : 80,
|
||||
variables: job.config.variables,
|
||||
deviceScaleFactor,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user