Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(debug): cover core child launch spec

Steven Enamakela049ada21b02
diff --git a/scripts/__tests__/debug-web-ui.test.mjs b/scripts/__tests__/debug-web-ui.test.mjs
index f5de269940..ed552c10f5 100644
--- a/scripts/__tests__/debug-web-ui.test.mjs
+++ b/scripts/__tests__/debug-web-ui.test.mjs
@@ -10,6 +10,7 @@ import {
isLoopback,
parseArgs,
runStamp,
+ startCoreChild,
waitFor,
} from "../debug/web-ui-lib.mjs";
@@ -38,6 +39,14 @@ test("coreLaunchSpec isolates the core from operator credentials, storage, and d
assert.equal(spec.env.OPENHUMAN_BACKEND_SESSION_TOKEN, undefined);
assert.equal(spec.env.OPENHUMAN_STORAGE_URL, undefined);
assert.equal(spec.env.RUST_LOG, "info");
+
+ let launch;
+ startCoreChild((...args) => (launch = args), "/private/openhuman-core", 18473, spec);
+ assert.equal(launch[0], "core");
+ assert.equal(launch[1], "/private/openhuman-core");
+ assert.deepEqual(launch[2], ["serve", "--port", "18473"]);
+ assert.equal(launch[3], spec.env);
+ assert.equal(launch[4], spec.cwd);
});
test("mergeChildEnv overrides and removes inherited variables", () => {
diff --git a/scripts/debug/web-ui.mjs b/scripts/debug/web-ui.mjs
index 8fe126eea9..e7cd0ba84d 100644
--- a/scripts/debug/web-ui.mjs
+++ b/scripts/debug/web-ui.mjs
@@ -28,6 +28,7 @@ import {
mergeChildEnv,
parseArgs,
runStamp,
+ startCoreChild,
USAGE,
waitFor,
} from "./web-ui-lib.mjs";
@@ -169,7 +170,7 @@ async function main() {
token,
logLevel: process.env.RUST_LOG ?? "info",
});
- startChild("core", core, ["serve", "--port", String(corePort)], coreLaunch.env, coreLaunch.cwd);
+ startCoreChild(startChild, core, corePort, coreLaunch);
await waitFor(async () => (await fetch(`http://127.0.0.1:${corePort}/health`)).ok, {
timeoutMs: 120_000,
what: "the core's /health",