Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(native-lock-prebuilds): native jobs install through the bounded wrapper, still frozen and script-free

garrytan764103eaa432
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0f6abd82a7..21b70f6992 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,7 +17,7 @@ identifiers and attribution are available in the pre-removal Git revision
### Itemized changes
- **`scripts/ci-bun-install.ts`** runs `bun install` with the flags it's given. An attempt that's still running after 180 s is killed and named in a `::warning::`, then retried once after 10 s. A second failure stops the step with `::error::bun install … stalled: no result after 180s … on attempt 2 of 2; giving up`. A failure that isn't a stall (a frozen-lockfile mismatch, an unreachable registry) keeps Bun's own output, is retried once, and is then reported with Bun's exit code. The script needs no dependencies, since it runs before they're installed, and spawns asynchronously, so it behaves the same on Linux, macOS and Windows. Its shape follows `scripts/ci-install-openclaw.sh`.
-- **Every root-package install in `.github/workflows/` uses it** (48 steps across nine workflows, plus the native musl container run). Each such step gets `timeout-minutes: 8` as a backstop; job timeouts are unchanged. The admin bundle install in `release.yml` stays as it is, since `test/release-workflow.test.ts` pins it as a supply-chain contract.
+- **Every root-package install in `.github/workflows/` uses it** (48 steps across nine workflows, plus the native musl container run). Each such step gets `timeout-minutes: 8` as a backstop; job timeouts are unchanged. The admin bundle install in `release.yml` stays as it is, since `test/release-workflow.test.ts` pins it as a supply-chain contract. `test/scripts/native-lock-prebuilds.test.ts` now requires the native matrix jobs to install through the wrapper, still with `--frozen-lockfile --ignore-scripts`.
- **Proof.**
- `test/scripts/ci-bun-install.test.ts` uses a stub `bun` whose first attempt really sleeps far past a 1 s bound. The case where the second attempt installs passes in about 1 s; with two stalls, it stops with the named error in about 2 s. Bun's own error and exit code come through on a non-stall failure, and a clean install runs once and prints no annotation. A workflow scan fails if a root `bun install --frozen-lockfile` step goes unwrapped, if a wrapped step lacks the 8-minute backstop, or if the wrapper's path does not resolve from the step's `working-directory` (the two `admin/` installs in `test.yml` call `bun ../scripts/ci-bun-install.ts`).
- A real `bun install` pointed at a registry that accepts connections and never answers was killed at a 5 s bound, retried, and stopped with the named error in 11 s.
diff --git a/test/scripts/native-lock-prebuilds.test.ts b/test/scripts/native-lock-prebuilds.test.ts
index 93dec79103..5a7739a744 100644
--- a/test/scripts/native-lock-prebuilds.test.ts
+++ b/test/scripts/native-lock-prebuilds.test.ts
@@ -93,7 +93,7 @@ describe('native lock distribution integrity', () => {
const matrix = job.strategy.matrix;
expect(matrix.bun).toEqual(['1.4.0', '1.4.3']);
const script = job.steps.map(step => step.run ?? '').join('\n');
- expect(script).toContain('bun install --frozen-lockfile --ignore-scripts');
+ expect(script).toContain('bun scripts/ci-bun-install.ts --frozen-lockfile --ignore-scripts');
const lockTests = script.split('\n').find(line => /\bbun test\b/.test(line) && line.includes('test/native-lock.test.ts'));
expect(lockTests).toBeDefined();
expect(lockTests!).toMatch(/--timeout(?:=|\s+)[1-9]\d*\b/);