Skip to content

armgit / hypit

Public Imported from GitHub
0

Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.

fix: tests compare against resolved paths, not POSIX spellings

rpone9f7c6ac63df6
diff --git a/packages/cli/test/programs-command.test.ts b/packages/cli/test/programs-command.test.ts
index d9e3784b..2f3068e5 100644
--- a/packages/cli/test/programs-command.test.ts
+++ b/packages/cli/test/programs-command.test.ts
@@ -1,4 +1,5 @@
import assert from "node:assert/strict";
+import { resolve } from "node:path";
import test from "node:test";
import { runCli } from "../src/main.js";
@@ -48,10 +49,13 @@ test("programs dispatches lifecycle through the selected Runtime Controller", as
await runCli(["programs", "up", "/p/hypit.runtime.json", "--max-wait-ms", "1000"], io, distribution(calls));
await runCli(["programs", "down", "/p/hypit.runtime.json"], io, distribution(calls));
await runCli(["programs", "status", "/p/hypit.runtime.json"], io, distribution(calls));
+ // The CLI resolves the profile it is given, and what resolving produces is the platform's own
+ // spelling. Asserting the argument back verbatim would only be asserting that this is POSIX.
+ const profile = resolve("/p/hypit.runtime.json");
assert.deepEqual(calls, [
- 'up /p/hypit.runtime.json {"maxWaitMs":1000}',
- "down /p/hypit.runtime.json",
- "report /p/hypit.runtime.json",
+ `up ${profile} {"maxWaitMs":1000}`,
+ `down ${profile}`,
+ `report ${profile}`,
]);
});
diff --git a/packages/provider-image-opencv-local/test/program.test.ts b/packages/provider-image-opencv-local/test/program.test.ts
index 8c061470..50c63e26 100644
--- a/packages/provider-image-opencv-local/test/program.test.ts
+++ b/packages/provider-image-opencv-local/test/program.test.ts
@@ -31,7 +31,12 @@ test("an interpreter without cv2 is reported here, not mid-Build", async () => {
assert.match(state.state === "down" ? state.detail : "", /cannot import cv2 and numpy/u);
});
-test("an interpreter carrying another OpenCV major is a mismatch, not a failure", async () => {
+test("an interpreter carrying another OpenCV major is a mismatch, not a failure", {
+ // The stand-in below is a shell script that answers through its shebang line, and Windows has
+ // no shebang: it would run nothing and report the interpreter down, which is the state this
+ // test exists to distinguish a mismatch from.
+ skip: process.platform === "win32" && "the stand-in interpreter answers through a shebang",
+}, async () => {
// A stand-in interpreter that answers truthfully about an environment this
// Provider cannot drive: cv2 3.x predates the APIs it calls.
const directory = await mkdtemp(join(tmpdir(), "hypit-opencv-probe-"));
diff --git a/packages/provider-image-opencv-local/test/provider.test.ts b/packages/provider-image-opencv-local/test/provider.test.ts
index ebb4b438..3ce5310a 100644
--- a/packages/provider-image-opencv-local/test/provider.test.ts
+++ b/packages/provider-image-opencv-local/test/provider.test.ts
@@ -1,5 +1,6 @@
import assert from "node:assert/strict";
import { spawnSync } from "node:child_process";
+import { join, resolve } from "node:path";
import test from "node:test";
import { artifactTypes } from "@hypit/artifact";
@@ -69,7 +70,10 @@ test("managed and external OpenCV deployments never mix their interpreters", ()
const managedContext = { dataRoot: "/project", instance: "opencv", config: {} } as const;
const managed = resolveLocalOpenCvDeployment(managedContext);
assert.equal(managed.ownership, "managed");
- assert.match(managed.pythonExecutable, /services\/image-opencv\/\.venv\/(?:bin\/python|Scripts\/python\.exe)$/u);
+ // The deployment already branches on the platform for the venv layout, so the tail it produces
+ // is joined with the platform's separator too. Spell the separator as either one.
+ assert.match(managed.pythonExecutable,
+ /services[\\/]image-opencv[\\/]\.venv[\\/](?:bin[\\/]python|Scripts[\\/]python\.exe)$/u);
assert.deepEqual(managed.prepare?.args.slice(-1), ["--frozen"]);
const managedProgram = localOpenCvProgram(managedContext);
assert.deepEqual(managedProgram.prepare, managed.prepare);
@@ -81,7 +85,7 @@ test("managed and external OpenCV deployments never mix their interpreters", ()
} as const;
const external = resolveLocalOpenCvDeployment(externalContext);
assert.equal(external.ownership, "external");
- assert.equal(external.pythonExecutable, "/project/tools/python");
+ assert.equal(external.pythonExecutable, resolve(join("/project", "tools", "python")));
assert.equal(external.prepare, undefined);
assert.equal(localOpenCvProgram(externalContext).prepare, undefined);
});