Skip to content

Commit e932160

Browse files
committed
test(release): expect public latest in installer smoke
1 parent 907e66d commit e932160

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

scripts/test-install-sh-docker.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,10 @@ else
444444
if [[ -f "$LATEST_FILE" ]]; then
445445
LATEST_VERSION="$(cat "$LATEST_FILE")"
446446
fi
447+
public_latest_version="$(quiet_npm view "$PACKAGE_NAME" version 2>/dev/null || true)"
448+
if [[ -n "$public_latest_version" ]]; then
449+
LATEST_VERSION="$public_latest_version"
450+
fi
447451

448452
echo "==> Run update smoke (${UPDATE_BASELINE_VERSION} -> ${UPDATE_EXPECT_VERSION})"
449453
run_install_smoke_container --rm -t \

test/scripts/test-install-sh-docker.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,16 @@ describe("test-install-sh-docker", () => {
321321
expect(runner).toContain('bash -c "curl -fsSL \\"\\$1\\" | bash -s --');
322322
expect(runner).not.toContain('npm_install_global "install latest release tarball"');
323323
});
324+
325+
it("uses public npm latest as the non-root installer expectation", () => {
326+
const wrapper = readFileSync(SCRIPT_PATH, "utf8");
327+
328+
expect(wrapper).toContain(
329+
'public_latest_version="$(quiet_npm view "$PACKAGE_NAME" version 2>/dev/null || true)"',
330+
);
331+
expect(wrapper).toContain('LATEST_VERSION="$public_latest_version"');
332+
expect(wrapper).toContain('-e OPENCLAW_INSTALL_EXPECT_VERSION="$LATEST_VERSION"');
333+
});
324334
});
325335

326336
describe("install-sh smoke runner", () => {

0 commit comments

Comments
 (0)