Skip to content

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

test(release): use a valid target in CLI tarball fixture

Steven Enamakeleccbd94a1ae8
diff --git a/scripts/__tests__/cli-package-contents.test.mjs b/scripts/__tests__/cli-package-contents.test.mjs
index fcbd26fb5d..3e7e835b6d 100644
--- a/scripts/__tests__/cli-package-contents.test.mjs
+++ b/scripts/__tests__/cli-package-contents.test.mjs
@@ -16,8 +16,30 @@ test("CLI tarballs contain the core and standalone TUI", () => {
const work = fs.mkdtempSync(path.join(os.tmpdir(), "openhuman-cli-package-"));
const core = path.join(work, "core-fixture");
const tui = path.join(work, "tui-fixture");
+ const fakeBin = path.join(work, "bin");
+ const nodeStub = path.join(fakeBin, "node");
fs.writeFileSync(core, "core");
fs.writeFileSync(tui, "tui");
+ fs.mkdirSync(fakeBin);
+ fs.writeFileSync(
+ nodeStub,
+ `#!/bin/sh
+set -eu
+test "$1" = "${path.join(repoRoot, "scripts/release/stage-modules.mjs")}" || exit 91
+shift
+while [ "$#" -gt 0 ]; do
+ if [ "$1" = "--output" ]; then
+ output="$2"
+ shift 2
+ else
+ shift
+ fi
+done
+mkdir -p "$output"
+: > "$output/.gitkeep"
+`,
+ { mode: 0o755 },
+ );
execFileSync(
"bash",
@@ -26,20 +48,35 @@ test("CLI tarballs contain the core and standalone TUI", () => {
core,
tui,
"0.0.0",
- "test-target",
+ "x86_64-unknown-linux-gnu",
],
- { cwd: work, env: { ...process.env, GITHUB_TOKEN: "" } },
+ {
+ cwd: work,
+ env: {
+ ...process.env,
+ PATH: `${fakeBin}${path.delimiter}${process.env.PATH}`,
+ GITHUB_TOKEN: "",
+ },
+ },
);
const entries = execFileSync(
"tar",
- ["-tzf", path.join(work, "openhuman-core-0.0.0-test-target.tar.gz")],
+ [
+ "-tzf",
+ path.join(work, "openhuman-core-0.0.0-x86_64-unknown-linux-gnu.tar.gz"),
+ ],
{ encoding: "utf8" },
)
.trim()
.split("\n")
.sort();
- assert.deepEqual(entries, ["openhuman-core", "openhuman-tui"]);
+ assert.deepEqual(entries, [
+ "bundled-modules/",
+ "bundled-modules/.gitkeep",
+ "openhuman-core",
+ "openhuman-tui",
+ ]);
});
test("package-manager consumers install and expose the TUI", () => {
@@ -83,8 +120,30 @@ test("Debian packages install both commands", () => {
const work = fs.mkdtempSync(path.join(os.tmpdir(), "openhuman-deb-package-"));
const core = path.join(work, "core-fixture");
const tui = path.join(work, "tui-fixture");
+ const fakeBin = path.join(work, "bin");
+ const nodeStub = path.join(fakeBin, "node");
fs.writeFileSync(core, "core");
fs.writeFileSync(tui, "tui");
+ fs.mkdirSync(fakeBin);
+ fs.writeFileSync(
+ nodeStub,
+ `#!/bin/sh
+set -eu
+test "$1" = "${path.join(repoRoot, "scripts/release/stage-modules.mjs")}" || exit 91
+shift
+while [ "$#" -gt 0 ]; do
+ if [ "$1" = "--output" ]; then
+ output="$2"
+ shift 2
+ else
+ shift
+ fi
+done
+mkdir -p "$output"
+: > "$output/.gitkeep"
+`,
+ { mode: 0o755 },
+ );
execFileSync(
"bash",