mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-25 08:32:45 +00:00
test(engine): the browser cache and remote tail tests pass the same on any machine (#8557)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// fallow-ignore-file code-duplication
|
||||
import { _resetChromeSandboxFallbackForTests } from "@hyperframes/core/chrome-sandbox";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { EventEmitter } from "node:events";
|
||||
import { chmodSync, existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
||||
@@ -1298,6 +1298,14 @@ function resolveHeadlessShellInSubprocess(
|
||||
describe("resolveHeadlessShellPath", () => {
|
||||
const originalHeadlessShellPath = process.env.PRODUCER_HEADLESS_SHELL_PATH;
|
||||
const originalHyperframesBrowserPath = process.env.HYPERFRAMES_BROWSER_PATH;
|
||||
// Ubuntu's umask 002 makes these fake caches group-writable, which the cache check refuses.
|
||||
let originalUmask = 0;
|
||||
beforeAll(() => {
|
||||
originalUmask = process.umask(0o022);
|
||||
});
|
||||
afterAll(() => {
|
||||
process.umask(originalUmask);
|
||||
});
|
||||
|
||||
// A runner may export either var (the Windows job sets HYPERFRAMES_BROWSER_PATH); each case sets its own.
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -5,7 +5,13 @@ import type { AddressInfo } from "node:net";
|
||||
import { tmpdir } from "node:os";
|
||||
import { usableCpuCount } from "./systemMemory.js";
|
||||
import { join } from "node:path";
|
||||
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
||||
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
|
||||
|
||||
// Four CPUs everywhere: extraction gets 2 slots, so tail reads beyond them show on any host.
|
||||
vi.mock("./systemMemory.js", async (importOriginal) => ({
|
||||
...(await importOriginal<typeof import("./systemMemory.js")>()),
|
||||
usableCpuCount: () => 4,
|
||||
}));
|
||||
import type { VideoElement } from "../types.js";
|
||||
import { getFfmpegBinary } from "../utils/ffmpegBinaries.js";
|
||||
import { declareContentAddressedUrl } from "../utils/ffprobe.js";
|
||||
|
||||
Reference in New Issue
Block a user