mirror of
https://github.com/hanzoai/frames.git
synced 2026-09-24 00:08:03 +00:00
Forked from HyperFrames (Apache-2.0), full history preserved. Hosts are mapped explicitly and BEFORE the identifier rename, because hyperframes.heygen.com is not decoration: 175 of its occurrences are $schema identifiers that a validator dereferences. A blind rename would have left them naming a host that never serves them. The schema files are in this repo under docs/schema, so the mapped host is one we can actually serve -- that is the condition that makes the rewrite safe, and serving them is a deploy task, not an edit. docs/schema/hyperframes.json is renamed to frames.json to match the identifier it is now published under. api.heygen.com and the CLI auth against heygen.com are left UNRENAMED on purpose. They are a dependency on HeyGen's SaaS, not a name of ours to take, and the right move is to remove that integration rather than rebrand it. LICENSE and CREDITS.md are untouched; NOTICE records the lineage. Co-authored-by: Hanzo Dev <[email protected]>
35 lines
1.3 KiB
JavaScript
35 lines
1.3 KiB
JavaScript
import { spawnSync } from "node:child_process";
|
|
import { discoverProducerTests, PRODUCER_ROOT } from "./test-classification.mjs";
|
|
|
|
const lane = process.argv[2];
|
|
const requestedRunner = process.argv[3];
|
|
if (lane !== "unit" && lane !== "integration") {
|
|
throw new Error("Usage: node scripts/run-test-lane.mjs <unit|integration> [bun|vitest]");
|
|
}
|
|
if (requestedRunner && requestedRunner !== "bun" && requestedRunner !== "vitest") {
|
|
throw new Error(`Unknown test runner: ${requestedRunner}`);
|
|
}
|
|
|
|
const tests = discoverProducerTests().filter(
|
|
(test) => test.lane === lane && (!requestedRunner || test.runner === requestedRunner),
|
|
);
|
|
|
|
function run(args) {
|
|
const result = spawnSync("bun", args, {
|
|
cwd: PRODUCER_ROOT,
|
|
env: { ...process.env, FRAMES_TEST_LANE: lane },
|
|
stdio: "inherit",
|
|
});
|
|
if (result.error) throw result.error;
|
|
if (result.status !== 0) process.exit(result.status ?? 1);
|
|
}
|
|
|
|
const vitestFiles = tests.filter((test) => test.runner === "vitest").map((test) => test.file);
|
|
if (vitestFiles.length > 0) run(["x", "vitest", "run", ...vitestFiles]);
|
|
|
|
// Bun's mock.module registry is process-global. Run each file in a fresh
|
|
// process so mocks from one source test cannot mutate another test's imports.
|
|
for (const test of tests.filter((entry) => entry.runner === "bun")) {
|
|
run(["test", test.file]);
|
|
}
|